Release Canary #47
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 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: | |
| get-runner-labels: | |
| name: Get Runner Labels | |
| uses: ./.github/workflows/get-runner-labels.yml | |
| with: | |
| force-use-github-runner: true | |
| build: | |
| name: Build Canary | |
| needs: [get-runner-labels] | |
| 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: 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: i686-pc-windows-msvc | |
| runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} | |
| - target: x86_64-pc-windows-msvc | |
| runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} | |
| - target: aarch64-pc-windows-msvc | |
| runner: ${{ needs.get-runner-labels.outputs.WINDOWS_RUNNER_LABELS }} | |
| - target: x86_64-apple-darwin | |
| runner: ${{ needs.get-runner-labels.outputs.MACOS_RUNNER_LABELS }} | |
| - target: aarch64-apple-darwin | |
| runner: ${{ needs.get-runner-labels.outputs.MACOS_RUNNER_LABELS }} | |
| - target: wasm32-wasip1-threads | |
| runner: ${{ vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"' }} | |
| uses: ./.github/workflows/reusable-build.yml | |
| with: | |
| ref: ${{inputs.commit || github.sha}} | |
| target: ${{ matrix.array.target }} | |
| runner: ${{ matrix.array.runner }} | |
| profile: ${{inputs.profile || 'release'}} | |
| test: ${{inputs.test || false}} | |
| release: | |
| name: Release Canary | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: npm-canary | |
| steps: | |
| - name: Checkout Branch | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{inputs.commit}} | |
| - name: Pnpm Setup | |
| uses: ./.github/actions/pnpm/setup | |
| - name: Pnpm Install | |
| uses: ./.github/actions/pnpm/install-dependencies | |
| - name: Download artifacts | |
| uses: actions/download-artifact@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 |