Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(binding/java): Enable release build only when releasing #3057

Merged
merged 8 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/bindings_php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@
name: Bindings PHP CI

on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
paths:
- "bindings/php/**"
- ".github/workflows/bindings_php.yml"
# Disable PHP build until https://github.com/apache/incubator-opendal/issues/3055 addressed
#
# push:
# branches:
# - main
# tags:
# - '*'
# pull_request:
# branches:
# - main
# paths:
# - "bindings/php/**"
# - ".github/workflows/bindings_php.yml"
workflow_dispatch:

concurrency:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+'
workflow_dispatch:

env:
OPENDAL_RELEASE: on

jobs:
stage-snapshot:
runs-on: ${{ matrix.os }}
Expand Down
7 changes: 6 additions & 1 deletion bindings/java/tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from pathlib import Path
import shutil
import subprocess
import os


def classifier_to_target(classifier: str) -> str:
Expand Down Expand Up @@ -54,7 +55,11 @@ def get_cargo_artifact_name(classifier: str) -> str:
parser.add_argument('--classifier', type=str, required=True)
args = parser.parse_args()

cmd = ['cargo', 'build', '--color=always', '--release']
cmd = ['cargo', 'build', '--color=always']

# Only enable release build while OPENDAL_RELEASE is on.
if os.environ.get('OPENDAL_RELEASE') == 'on':
tisonkun marked this conversation as resolved.
Show resolved Hide resolved
cmd.append('--release')

target = classifier_to_target(args.classifier)
if target:
Expand Down
Loading