Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
description: Dry run (do not publish the packages)
required: true
type: boolean
npm_tag:
description: "[Custom releases only] npm tag to use"
required: false
type: string

permissions:
id-token: write # Required for OIDC
Expand Down Expand Up @@ -107,8 +111,26 @@ jobs:
}
return `--workspaces ${process.env.WORKSPACES.split(',').join(' ')}`;
result-encoding: string
- name: Prepare npm tag
id: prepare_npm_tag_arg
uses: actions/github-script@v8
env:
NPM_TAG: ${{ inputs.npm_tag }}
with:
# language=javascript
script: |
if (!process.env.NPM_TAG || typeof process.env.NPM_TAG !== 'string') {
return '';
}

if (process.env.NPM_TAG === 'latest') {
throw new Error('npm_tag cannot be set to "latest" for snapshot releases!');
}

return `--tag ${process.env.NPM_TAG}`;
result-encoding: string
- name: Release
run: yarn release run snapshot --skip-prompts --skip-auth-check --use-auth-token --allow-custom ${{ inputs.dry_run && '--dry-run' || ''}} ${{ steps.prepare_workspaces_arg.outputs.result }}
run: yarn release run snapshot --skip-prompts --skip-auth-check --use-auth-token --allow-custom ${{ inputs.dry_run && '--dry-run' || ''}} ${{ steps.prepare_npm_tag_arg.outputs.result }} ${{ steps.prepare_workspaces_arg.outputs.result }}
release_official:
name: Create an official release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -158,5 +180,18 @@ jobs:
}
return `--workspaces ${process.env.WORKSPACES.split(',').join(' ')}`;
result-encoding: string
- name: Prepare npm tag
id: prepare_npm_tag_arg
uses: actions/github-script@v8
env:
NPM_TAG: ${{ inputs.npm_tag }}
with:
# language=javascript
script: |
if (!process.env.NPM_TAG || typeof process.env.NPM_TAG !== 'string') {
return '';
}
return `--tag ${process.env.NPM_TAG}`;
result-encoding: string
- name: Release
run: yarn release run official --skip-prompts --skip-auth-check --use-auth-token --allow-custom --skip-update-versions ${{ inputs.dry_run && '--dry-run' || ''}} ${{ steps.prepare_workspaces_arg.outputs.result }}
run: yarn release run official --skip-prompts --skip-auth-check --use-auth-token --allow-custom --skip-update-versions ${{ inputs.dry_run && '--dry-run' || ''}} ${{ steps.prepare_npm_tag_arg.outputs.result }} ${{ steps.prepare_workspaces_arg.outputs.result }}