Skip to content

Bump version (#2058) #5692

Bump version (#2058)

Bump version (#2058) #5692

Workflow file for this run

name: release
on:
push:
branches:
- main
pull_request:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
cargo:
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/main' && 'release' || 'test' }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: tools/ci/release.sh ${{ github.ref == 'refs/heads/main' && '--' || '--dry-run' }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
wasm:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/main' && 'release' || 'test' }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: cargo install wasm-pack
- run: wasm-pack build --target web wasm
- run: |
jq '. + input' pkg/package.json package.json > /tmp/package.json
mv /tmp/package.json pkg
working-directory: wasm
- run: wasm-pack pack wasm
- uses: js-devtools/npm-publish@v3
with:
access: public
package: wasm/pkg
provenance: true
token: ${{ secrets.NPM_TOKEN }}
if: github.ref == 'refs/heads/main'
goreleaser:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- uses: mlugg/setup-zig@v1
- run: cargo install --locked cargo-zigbuild
- id: version
run: echo version=v$(cargo run --bin stak -- --version | grep -o '[0-9.]*') > ${{ github.output }}
- uses: raviqqe/goreleaser-action@v1
with:
version: ${{ steps.version.outputs.version }}
snapshot: ${{ github.ref != 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
needs:
- cargo
- goreleaser
- wasm
if: always()
runs-on: ubuntu-latest
steps:
- run: for result in ${{ join(needs.*.result, ' ') }}; do [ $result = success ]; done