Release intl ecosystem #51
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
commit: | |
required: true | |
type: string | |
description: 'Commit SHA' | |
publish: | |
required: true | |
type: boolean | |
description: "Publish to NPM?" | |
permissions: | |
# To publish packages with provenance | |
id-token: write | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false # Build and test everything so we can look at all the errors | |
matrix: | |
target: | |
# Linux | |
- ['ubuntu-latest', 'linux-x64-gnu'] | |
- ['ubuntu-latest', 'linux-arm64-gnu'] | |
- ['ubuntu-latest', 'linux-x64-musl'] | |
- ['ubuntu-latest', 'linux-arm64-musl'] | |
# Windows | |
- ['windows-latest', 'win32-ia32-msvc'] | |
- ['windows-latest', 'win32-x64-msvc'] | |
- ['windows-latest', 'win32-arm64-msvc'] | |
# macOS | |
- ['macos-latest', 'darwin-x64'] | |
- ['macos-latest', 'darwin-arm64'] | |
uses: ./.github/workflows/build-intl-message-database.yaml | |
with: | |
# Using napi and cargo-zigbuild/cargo-xwin, everything _should_ be buildable on ubuntu directly. | |
runner: ${{ matrix.target[0] }} | |
target: ${{ matrix.target[1] }} | |
ref: ${{inputs.commit}} | |
publish: ${{inputs.publish}} | |
secrets: inherit | |
release: | |
name: Release and Publish | |
needs: [build] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
# To publish packages with provenance | |
id-token: write | |
if: inputs.publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Build Env | |
uses: ./.github/actions/setup-build-env | |
with: | |
native: false | |
ref: ${{ inputs.ref }} | |
target: any | |
- name: Download package artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ~/artifacts | |
merge-multiple: true | |
- name: Move build artifacts into packages | |
run: | | |
pnpm intl-cli util move-gh-artifacts ~/artifacts | |
- name: Check package versions | |
run: | | |
pnpm intl-cli db version-check | |
- name: Publish all @discord/intl-message-database* packages | |
run: | | |
pnpm intl-cli db publish-all --provenance --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |