Release intl ecosystem #129
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 intl ecosystem | |
on: | |
workflow_dispatch: | |
inputs: | |
commit: | |
required: true | |
type: string | |
description: 'Commit SHA' | |
publish: | |
required: true | |
type: boolean | |
description: "Publish to NPM?" | |
tag: | |
required: false | |
type: string | |
default: 'latest' | |
description: "NPM version tag" | |
choices: | |
- latest | |
- canary | |
fail-fast: | |
required: false | |
type: boolean | |
default: false | |
description: 'Fail fast?' | |
permissions: | |
# To publish packages with provenance | |
contents: write | |
id-token: write | |
jobs: | |
build-db: | |
name: Build intl-message-database | |
strategy: | |
fail-fast: ${{inputs.fail-fast}} | |
matrix: | |
target: | |
# Linux | |
- ['ubuntu-20.04', 'linux-x64-gnu'] | |
- ['ubuntu-20.04', 'linux-arm64-gnu'] | |
- ['ubuntu-20.04', 'linux-x64-musl'] | |
- ['ubuntu-20.04', '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}} | |
secrets: inherit | |
build-swc: | |
name: Build @discord/swc-intl-message-transformer | |
uses: ./.github/workflows/build-swc-intl-message-transformer.yaml | |
with: | |
ref: ${{inputs.commit}} | |
lint: | |
name: Lint JS package builds | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Build Env | |
uses: ./.github/actions/setup-build-env | |
with: | |
native: false | |
ref: ${{ inputs.ref }} | |
target: wasm | |
- name: Check JS packages build successfully | |
# Ignoring `swc` because it's `build` command invokes cargo build. | |
run: | | |
pnpm --filter \!"swc*" -r build | |
release: | |
name: Release and Publish | |
needs: | |
- lint | |
- build-db | |
- build-swc | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
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: wasm | |
- 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: Set ${{inputs.tag}} version for all packages | |
if: ${{inputs.tag == 'canary'}} | |
run: | | |
pnpm intl-cli ecosystem version bump canary | |
- name: Check package version equality | |
if: ${{inputs.tag != 'canary'}} | |
run: | | |
pnpm intl-cli ecosystem version check | |
- name: Publish all @discord/intl-message-database* packages | |
run: | | |
pnpm intl-cli ecosystem publish-all --provenance --access public --no-git-checks --tag ${{inputs.tag}} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |