Publish Release #37
Workflow file for this run
This file contains 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 Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
name: Publish crates | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Install cargo-workspaces | |
run: cargo install cargo-workspaces | |
- name: Release | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
PATCH: ${{ github.run_number }} | |
shell: bash | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Action" | |
cargo workspaces publish \ | |
--from-git \ | |
--yes \ | |
--no-git-commit \ | |
skip | |
npm_publish: | |
name: Publish NPM package (wasm) | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: wasm32-unknown-unknown | |
- name: Install wasm-pack | |
uses: jetli/[email protected] | |
with: | |
version: 'latest' | |
- name: Build boa_wasm | |
run: wasm-pack build --scope boa-dev ./ffi/wasm | |
- name: Set-up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Set-up npm config for publishing | |
run: npm config set -- '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}" | |
- name: Publish to npm | |
run: npm publish ./ffi/wasm/pkg --access=public | |
release-binaries: | |
name: Publish binaries | |
needs: publish | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [linux, macos, win-msvc] | |
include: | |
- build: linux | |
os: ubuntu-20.04 | |
rust: stable | |
target: x86_64-unknown-linux-gnu | |
asset_name: boa-linux-amd64 | |
binary_name: boa | |
- build: macos | |
os: macos-latest | |
rust: stable | |
target: x86_64-apple-darwin | |
asset_name: boa-macos-amd64 | |
binary_name: boa | |
- build: win-msvc | |
os: windows-2019 | |
rust: stable | |
target: x86_64-pc-windows-msvc | |
asset_name: boa-windows-amd64.exe | |
binary_name: boa.exe | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Build | |
run: cargo build --target ${{ matrix.target }} --verbose --release --locked --bin boa | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/${{ matrix.target }}/release/${{ matrix.binary_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} |