From 643d9662841777375d828c3ee6608ddb0f4747bf Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 19 Feb 2024 23:47:45 +0800 Subject: [PATCH] ci: Add support for releasing all rust packages (#4200) --- .../{release_core.yml => release_rust.yml} | 32 +++++++++++++------ bin/oay/Cargo.toml | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) rename .github/workflows/{release_core.yml => release_rust.yml} (66%) diff --git a/.github/workflows/release_core.yml b/.github/workflows/release_rust.yml similarity index 66% rename from .github/workflows/release_core.yml rename to .github/workflows/release_rust.yml index e87c6c8144ef..afacf808ba91 100644 --- a/.github/workflows/release_core.yml +++ b/.github/workflows/release_rust.yml @@ -15,7 +15,9 @@ # specific language governing permissions and limitations # under the License. -name: Publish +# This workflow is used for publish all rust based packages + +name: Release Rust Packages on: push: @@ -25,13 +27,24 @@ on: branches: - main paths: - - ".github/workflows/release_core.yml" + - ".github/workflows/release_rust.yml" workflow_dispatch: jobs: publish: runs-on: ubuntu-latest - if: "startsWith(github.ref, 'refs/tags/')" + strategy: + # Publish package one by one instead of flooding the registry + max-parallel: 1 + matrix: + # Order here is sensitive, as it will be used to determine the order of publishing + package: + - "core" + - "integrations/dav-server" + - "integrations/object_store" + - "bin/oay" # depends on integrations/dav-server + - "bin/oli" + - "bin/ofs" steps: - uses: actions/checkout@v4 - name: Checkout python env @@ -50,17 +63,16 @@ jobs: need-rocksdb: true need-protoc: true - - name: Dryrun opendal - working-directory: "core" - if: "contains(github.ref, '-')" + - name: Dryrun ${{ matrix.package }} + working-directory: ${{ matrix.package }} run: cargo publish --all-features --dry-run env: LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - name: Publish opendal - working-directory: "core" - if: "!contains(github.ref, '-')" + - name: Publish ${{ matrix.package }} + working-directory: ${{ matrix.package }} + # Only publish if it's a tag and the tag is not a pre-release + if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') }} run: cargo publish --all-features env: LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }} diff --git a/bin/oay/Cargo.toml b/bin/oay/Cargo.toml index f95b78e56069..b1adc22a5c6c 100644 --- a/bin/oay/Cargo.toml +++ b/bin/oay/Cargo.toml @@ -47,7 +47,7 @@ bytes = { version = "1.5.0", optional = true } chrono = "0.4.31" clap = { version = "4", features = ["cargo", "string"] } dav-server = { version = "0.5.8", optional = true } -dav-server-opendalfs = { path = "../../integrations/dav-server", optional = true } +dav-server-opendalfs = { version = "0.0.0", path = "../../integrations/dav-server", optional = true } dirs = "5.0.1" futures = "0.3" futures-util = { version = "0.3.29", optional = true }