Publish 1.11.3 #385
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: "Publish" | |
run-name: "Publish ${{ inputs.version }}" | |
env: | |
CI: 1 | |
# 7 GiB by default on GitHub, setting to 6 GiB | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
NODE_OPTIONS: --max-old-space-size=6144 | |
GIT_AUTHOR_NAME: "SWC Bot" | |
GIT_AUTHOR_EMAIL: "bot@swc.rs" | |
GIT_COMMITTER_NAME: "SWC Bot" | |
GIT_COMMITTER_EMAIL: "bot@swc.rs" | |
# https://github.com/actions/setup-node/issues/899#issuecomment-1819151595 | |
SKIP_YARN_COREPACK_CHECK: 1 | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version to publish" | |
required: true | |
type: string | |
skipBuild: | |
description: "Skip build. Used to debug swc-ecosystem-ci." | |
required: false | |
type: boolean | |
default: false | |
onlyNightly: | |
description: "Publish only nightly" | |
required: false | |
type: boolean | |
default: false | |
allowBreakingWasm: | |
description: "Allow breaking changes in wasm" | |
required: false | |
type: boolean | |
default: false | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
determine-nightly-version: | |
name: "Determine nightly version" | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.determine-nightly-version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-node | |
- name: Determine nightly version | |
id: determine-nightly-version | |
run: | | |
npx ts-node .github/bot/src/nightly-version.ts ${{ github.event.inputs.version }} >> $GITHUB_OUTPUT | |
git-tag-nightly: | |
name: "Git tag nightly" | |
runs-on: ubuntu-latest | |
needs: | |
- determine-nightly-version | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/tag-git-release | |
if: inputs.skipBuild == false | |
with: | |
version: ${{ needs.determine-nightly-version.outputs.version }} | |
ssh-private-key: ${{ secrets.SWC_BOT_SSH }} | |
publish-npm-nightly: | |
name: "Publish ${{ matrix.package }}@${{ needs.determine-nightly-version.outputs.version }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
package: | |
- core | |
- html | |
needs: | |
- git-tag-nightly | |
- determine-nightly-version | |
uses: ./.github/workflows/publish-npm-package.yml | |
secrets: inherit | |
with: | |
package: ${{ matrix.package }} | |
version: ${{ needs.determine-nightly-version.outputs.version }} | |
buildCli: true | |
skipBuild: ${{ inputs.skipBuild || false }} | |
skipPublishing: ${{ github.event_name == 'pull_request' }} | |
run-ecosystem-ci-with-nightly: | |
name: "Test nightly using ecosystem CI" | |
needs: | |
- determine-nightly-version | |
- publish-npm-nightly | |
uses: ./.github/workflows/ecosystem-ci.yml | |
with: | |
version: ${{ needs.determine-nightly-version.outputs.version }} | |
mode: "passing" | |
suites: '["_"]' | |
allowBreakingWasm: ${{ inputs.allowBreakingWasm || false }} | |
git-tag-stable: | |
name: "Git tag stable" | |
runs-on: ubuntu-latest | |
if: inputs.onlyNightly == false | |
needs: | |
- run-ecosystem-ci-with-nightly | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/tag-git-release | |
if: inputs.skipBuild == false | |
with: | |
version: ${{ inputs.version }} | |
ssh-private-key: ${{ secrets.SWC_BOT_SSH }} | |
publish-npm-stable: | |
name: "Publish ${{ matrix.package }}@${{ inputs.version || 'stable' }} to npm" | |
strategy: | |
fail-fast: false | |
matrix: | |
package: | |
- core | |
- html | |
needs: | |
- run-ecosystem-ci-with-nightly | |
- git-tag-stable | |
uses: ./.github/workflows/publish-npm-package.yml | |
secrets: inherit | |
with: | |
package: ${{ matrix.package }} | |
version: ${{ inputs.version }} | |
buildCli: true | |
skipBuild: ${{ inputs.skipBuild || inputs.onlyNightly || false }} | |
skipPublishing: ${{ github.event_name == 'pull_request' }} |