From 16a6bd9f933ad1b1027b6620c3af59febb0f2a18 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 19 Feb 2024 16:19:57 +0800 Subject: [PATCH 1/6] ci: Add support for releasing all rust packages Signed-off-by: Xuanwo --- .../{release_core.yml => release_rust.yml} | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) rename .github/workflows/{release_core.yml => release_rust.yml} (80%) diff --git a/.github/workflows/release_core.yml b/.github/workflows/release_rust.yml similarity index 80% rename from .github/workflows/release_core.yml rename to .github/workflows/release_rust.yml index e87c6c8144ef..abd0e467dc5d 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: @@ -32,6 +34,17 @@ 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: + package: + - "core" + - "bin/oay" + - "bin/oli" + - "bin/ofs" + - "integrations/dav-server" + - "integrations/object_store" steps: - uses: actions/checkout@v4 - name: Checkout python env @@ -51,7 +64,7 @@ jobs: need-protoc: true - name: Dryrun opendal - working-directory: "core" + working-directory: ${{ matrix.package }} if: "contains(github.ref, '-')" run: cargo publish --all-features --dry-run env: @@ -59,7 +72,7 @@ jobs: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - name: Publish opendal - working-directory: "core" + working-directory: ${{ matrix.package }} if: "!contains(github.ref, '-')" run: cargo publish --all-features env: From c96dbb26d04a7b90f30b579e9cd8a950026b5002 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 19 Feb 2024 16:26:20 +0800 Subject: [PATCH 2/6] Update Signed-off-by: Xuanwo --- .github/workflows/release_rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release_rust.yml b/.github/workflows/release_rust.yml index abd0e467dc5d..9b7985cb65ed 100644 --- a/.github/workflows/release_rust.yml +++ b/.github/workflows/release_rust.yml @@ -38,6 +38,7 @@ jobs: # 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" - "bin/oay" From 289d8ad9a8da9b80a16dc179441cd1ada3630579 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 19 Feb 2024 16:27:19 +0800 Subject: [PATCH 3/6] Fix typo Signed-off-by: Xuanwo --- .github/workflows/release_rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_rust.yml b/.github/workflows/release_rust.yml index 9b7985cb65ed..b45fbd578549 100644 --- a/.github/workflows/release_rust.yml +++ b/.github/workflows/release_rust.yml @@ -27,7 +27,7 @@ on: branches: - main paths: - - ".github/workflows/release_core.yml" + - ".github/workflows/release_rust.yml" workflow_dispatch: jobs: From 5821973830504fa5ca3b8642e90501d689d0be68 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 19 Feb 2024 16:31:33 +0800 Subject: [PATCH 4/6] try Signed-off-by: Xuanwo --- .github/workflows/release_rust.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_rust.yml b/.github/workflows/release_rust.yml index b45fbd578549..6b9fcd7d5c3b 100644 --- a/.github/workflows/release_rust.yml +++ b/.github/workflows/release_rust.yml @@ -64,15 +64,13 @@ jobs: need-rocksdb: true need-protoc: true - - name: Dryrun opendal + - name: Dryrun ${{ matrix.package }} working-directory: ${{ matrix.package }} - if: "contains(github.ref, '-')" 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 + - name: Publish ${{ matrix.package }} working-directory: ${{ matrix.package }} if: "!contains(github.ref, '-')" run: cargo publish --all-features From 0b609ba12b58b90d08838df77e1973eefc4a202b Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 19 Feb 2024 16:33:57 +0800 Subject: [PATCH 5/6] Allow build Signed-off-by: Xuanwo --- .github/workflows/release_rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_rust.yml b/.github/workflows/release_rust.yml index 6b9fcd7d5c3b..49bfc7c35cdd 100644 --- a/.github/workflows/release_rust.yml +++ b/.github/workflows/release_rust.yml @@ -33,7 +33,6 @@ on: 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 @@ -72,7 +71,8 @@ jobs: - name: Publish ${{ matrix.package }} working-directory: ${{ matrix.package }} - if: "!contains(github.ref, '-')" + # 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 }} From 00f2fe2fb120dc7f57b9208b8083b0f54c796f16 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 19 Feb 2024 16:46:40 +0800 Subject: [PATCH 6/6] Fix build Signed-off-by: Xuanwo --- .github/workflows/release_rust.yml | 6 +++--- bin/oay/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release_rust.yml b/.github/workflows/release_rust.yml index 49bfc7c35cdd..afacf808ba91 100644 --- a/.github/workflows/release_rust.yml +++ b/.github/workflows/release_rust.yml @@ -40,11 +40,11 @@ jobs: # Order here is sensitive, as it will be used to determine the order of publishing package: - "core" - - "bin/oay" - - "bin/oli" - - "bin/ofs" - "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 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 }