Skip to content

Commit

Permalink
ci: Add support for releasing all rust packages (#4200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuanwo authored Feb 19, 2024
1 parent 39e0a69 commit 643d966
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion bin/oay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 643d966

Please sign in to comment.