-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (29 loc) · 1.02 KB
/
release.yml
File metadata and controls
36 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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@v6.0.2
- 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