Skip to content

Release Canary

Release Canary #8339

name: Release Canary
on:
schedule:
- cron: '0 17 * * *'
workflow_dispatch:
inputs:
commit:
required: true
type: string
description: 'Commit SHA'
test:
required: false
type: boolean
default: false
description: 'Run tests'
profile:
required: true
type: choice
default: release
options:
- release
- profiling
- ci
- debug
description: 'profiling means release with debug info for profiling, ci means release with debug info and faster build time'
permissions:
# To publish packages with provenance
id-token: write
# Allow commenting on issues for `reusable-build.yml`
issues: write
jobs:
build:
name: Build Canary
if: ${{ github.repository == 'web-infra-dev/rspack' }}
strategy:
fail-fast: false
matrix:
array:
- target: x86_64-unknown-linux-gnu
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: aarch64-unknown-linux-gnu
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: riscv64gc-unknown-linux-gnu
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: x86_64-unknown-linux-musl
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: aarch64-unknown-linux-musl
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: riscv64gc-unknown-linux-musl
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: powerpc64le-unknown-linux-gnu
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: s390x-unknown-linux-gnu
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
- target: i686-pc-windows-msvc
runner: ${{ vars.WINDOWS_SELF_HOSTED_RUNNER_LABELS || '"windows-latest"' }}
- target: x86_64-pc-windows-msvc
runner: ${{ vars.WINDOWS_SELF_HOSTED_RUNNER_LABELS || '"windows-latest"' }}
- target: aarch64-pc-windows-msvc
runner: ${{ vars.WINDOWS_SELF_HOSTED_RUNNER_LABELS || '"windows-latest"' }}
- target: x86_64-apple-darwin
runner: ${{ vars.MAC_SELF_HOSTED_RUNNER_LABELS || '"macos-latest"' }}
- target: aarch64-apple-darwin
runner: ${{ vars.MAC_SELF_HOSTED_RUNNER_LABELS || '"macos-latest"' }}
# Build the wasi and browser wasm variants as two parallel jobs (one
# variant per runner). Only the wasi (node) variant runs the wasm
# tests; the browser variant is build-only. Published wasm always uses
# the optimized release-wasi build with both variants compiled
# separately, so pin profile=release regardless of the canary profile.
- target: wasm32-wasip1-threads
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
profile: release
- target: wasm32-wasip1-threads
runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }}
binding_postfix: '-browser'
profile: release
uses: ./.github/workflows/reusable-build.yml
with:
ref: ${{inputs.commit || github.sha}}
target: ${{ matrix.array.target }}
runner: ${{ matrix.array.runner }}
binding_postfix: ${{ matrix.array.binding_postfix }}
profile: ${{ matrix.array.profile || inputs.profile || 'release'}}
test: ${{inputs.test || false}}
release:
name: Release Canary
if: ${{ github.repository == 'web-infra-dev/rspack' }}
runs-on: ubuntu-latest
needs: build
environment: npm-canary
steps:
- name: Checkout Branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 1
ref: ${{inputs.commit}}
- name: Pnpm Setup
uses: ./.github/actions/pnpm/setup
with:
node-version: 24
- name: Pnpm Install
run: pnpm i
- name: Download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
path: artifacts
pattern: bindings-*
- name: Clean artifacts
run: find artifacts -type f -name '*.d.ts' | xargs rm -f
- name: Move artifacts
run: |
ls -R artifacts
node scripts/build-npm.cjs
- name: Show binding packages
run: ls -R npm
# Update npm to the latest version to enable OIDC
- name: Update npm
run: |
npm install -g npm@latest
npm --version
- name: Release
run: |
./x version snapshot
pnpm run build:js:canary
./x publish snapshot --tag latest