Release Full #1552
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: Release Full | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
type: choice | |
description: "Release Npm Tag" | |
required: true | |
default: "latest" | |
options: | |
- canary | |
- nightly | |
- latest | |
- beta | |
- alpha | |
dry_run: | |
type: boolean | |
description: "DryRun release" | |
required: true | |
default: false | |
push_tags: | |
type: boolean | |
description: "push tags to github" | |
required: true | |
default: true | |
permissions: | |
# To publish packages with provenance | |
id-token: write | |
jobs: | |
get-runner-labels: | |
name: Get Runner Labels | |
uses: ./.github/workflows/get-runner-labels.yml | |
with: | |
force-use-github-runner: true | |
build: | |
needs: [get-runner-labels] | |
strategy: | |
fail-fast: false # Build and test everything so we can look at all the errors | |
matrix: | |
array: | |
- target: x86_64-unknown-linux-gnu | |
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | |
- target: aarch64-unknown-linux-gnu | |
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | |
- target: x86_64-unknown-linux-musl | |
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | |
- target: aarch64-unknown-linux-musl | |
runner: ${{ needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS }} | |
- 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 }} | |
uses: ./.github/workflows/reusable-build.yml | |
with: | |
target: ${{ matrix.array.target }} | |
runner: ${{ matrix.array.runner }} | |
profile: "release-prod" | |
release: | |
name: Release | |
permissions: | |
contents: write | |
# To publish packages with provenance | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
with: | |
# This makes Actions fetch only one branch to release | |
fetch-depth: 1 | |
- name: Pnpm Cache | |
uses: ./.github/actions/pnpm-cache | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Build node packages | |
run: pnpm run build:js | |
- name: Move artifacts | |
run: node scripts/build-npm.cjs | |
- name: Show binding packages | |
run: ls -R npm | |
- name: Link optional dependencies | |
run: pnpm install --no-frozen-lockfile | |
- name: Release Full | |
run: | | |
./x publish stable --tag ${{inputs.tag}} ${{inputs.dry_run && '--dry-run' || '--no-dry-run'}} ${{inputs.push_tags && '--push-tags' || '--no-push-tags'}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
REPOSITORY: ${{ github.repository }} | |
REF: ${{ github.ref }} | |
ONLY_RELEASE_TAG: true | |
- name: Release Nightly(After Full) | |
run: | | |
./x version snapshot | |
./x publish snapshot --tag nightly | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
REPOSITORY: ${{ github.repository }} | |
REF: ${{ github.ref }} | |
ONLY_RELEASE_TAG: true |