Skip to content

Commit

Permalink
ci(docs/release.yml): add crates publishing job; update release proce…
Browse files Browse the repository at this point in the history
…ss (#2160)

Signed-off-by: Vaughn Dice <[email protected]>
  • Loading branch information
vdice authored Dec 13, 2023
1 parent 09a0434 commit 0551e06
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -469,3 +469,23 @@ jobs:
file: _dist/spin-${{ env.RELEASE_VERSION }}-static-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
tag: ${{ github.ref }}
prerelease: ${{ steps.release-version.outputs.prerelease == 'true' }}

crates:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: build-and-sign
if: |
startsWith(github.ref, 'refs/tags/v') &&
github.repository_owner == 'fermyon'
steps:
- uses: actions/checkout@v2

- name: Publish spin-macro to crates.io
working-directory: ./sdk/rust/macro
run: |
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Publish spin-sdk to crates.io
working-directory: ./sdk/rust
run: |
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
3 changes: 3 additions & 0 deletions docs/content/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ To cut a major / minor release of Spin, you will need to do the following:

1. Switch to the release branch locally and update versions (e.g. `2.0.0-pre0` could be `2.0.0`).
- Bump the version in Spin's `Cargo.toml`
- Bump the `spin-macro` version to the same in the spin-sdk's [Cargo.toml](../../sdk/rust/Cargo.toml)
- Run `make build update-cargo-locks` so that `Cargo.lock` and example/test `Cargo.lock` files are updated

PR these changes to the release branch ensuring that pull request has a base corresponding to the release branch (e.g. `v2.0`).
Expand Down Expand Up @@ -61,6 +62,7 @@ $ ./.github/gh-backport.sh <pull-request> <branch-name>
1. Switch to the release branch locally and update versions (e.g. `2.0.0` could be `2.0.1`).
- Bump the version in Spin's `Cargo.toml`
- Bump the `spin-macro` version to the same in the spin-sdk's [Cargo.toml](../../sdk/rust/Cargo.toml)
- Run `make build update-cargo-locks` so that `Cargo.lock` and example/test `Cargo.lock` files are updated
PR these changes to the release branch ensuring that pull request has a base corresponding to the release branch (e.g. `v2.0`).
Expand Down Expand Up @@ -99,6 +101,7 @@ Otherwise, switch to the branch locally.
1. Update the Spin version with `-rc.N` where `N` is the release candidate number (e.g. `2.0.0-pre0` could be `2.0.0-rc.1`).
- Bump the version in Spin's `Cargo.toml`
- Bump the `spin-macro` version to the same in the spin-sdk's [Cargo.toml](../../sdk/rust/Cargo.toml)
- Run `make build update-cargo-locks` so that `Cargo.lock` and example/test `Cargo.lock` files are updated
PR these changes to the release branch ensuring that pull request has a base corresponding to the release branch (e.g. `v2.0`).
Expand Down

0 comments on commit 0551e06

Please sign in to comment.