Repository navigation
style: format changelog test code for consistency #7
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| if: github.ref_name == 'main' | |
| runs-on: ubuntu-latest | |
| env: | |
| CI: true | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-apple-darwin,aarch64-apple-darwin,x86_64-pc-windows-msvc | |
| - name: Set up Zig | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.14.1 | |
| - name: Install cross-compilation tools | |
| run: | | |
| cargo install cargo-zigbuild --locked | |
| cargo install cargo-xwin --locked | |
| - name: Install Node dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Create version pull request or publish | |
| uses: ./ | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: rivet-release | |
| check: cargo run --release --bin rivet -- check --json | |
| version: cargo run --release --bin rivet -- bump | |
| publish: | | |
| set -euo pipefail | |
| pnpm --dir packages/rivet exec napi build --target x86_64-unknown-linux-gnu --release -x | |
| pnpm --dir packages/rivet exec napi build --target x86_64-pc-windows-msvc --release -x | |
| pnpm --dir packages/rivet exec napi build --target x86_64-apple-darwin --release -x | |
| pnpm --dir packages/rivet exec napi build --target aarch64-apple-darwin --release -x | |
| cd packages/rivet | |
| pnpm exec napi create-npm-dirs | |
| cp ../../target/x86_64-unknown-linux-gnu/release/librivet.so npm/linux-x64-gnu/rivet-native.linux-x64-gnu.node | |
| cp ../../target/x86_64-apple-darwin/release/librivet.dylib npm/darwin-x64/rivet-native.darwin-x64.node | |
| cp ../../target/aarch64-apple-darwin/release/librivet.dylib npm/darwin-arm64/rivet-native.darwin-arm64.node | |
| cp ../../target/x86_64-pc-windows-msvc/release/rivet.dll npm/win32-x64-msvc/rivet-native.win32-x64-msvc.node | |
| cd ../.. | |
| cargo run --release --bin rivet -- release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |