Publish to crates.io #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to crates.io | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for trusted publishing OIDC token exchange | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Set crate version from release tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| echo "Publishing version: $VERSION" | |
| sed -i 's/^version = ".*"/version = "'"$VERSION"'"/' Cargo.toml | |
| sed -i 's/\(multistore[a-z-]* = {.*version = "\)[^"]*/\1'"$VERSION"'/' Cargo.toml | |
| - uses: rust-lang/crates-io-auth-action@v1 | |
| id: auth | |
| - name: Publish crates | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | |
| run: | | |
| cargo publish --workspace --exclude multistore-cf-workers | |
| cargo publish -p multistore-cf-workers --target wasm32-unknown-unknown |