|
23 | 23 | description: Dry run (do not publish the packages) |
24 | 24 | required: true |
25 | 25 | type: boolean |
| 26 | + npm_tag: |
| 27 | + description: "[Custom releases only] npm tag to use" |
| 28 | + required: false |
| 29 | + type: string |
26 | 30 |
|
27 | 31 | permissions: |
28 | 32 | id-token: write # Required for OIDC |
@@ -107,8 +111,26 @@ jobs: |
107 | 111 | } |
108 | 112 | return `--workspaces ${process.env.WORKSPACES.split(',').join(' ')}`; |
109 | 113 | result-encoding: string |
| 114 | + - name: Prepare npm tag |
| 115 | + id: prepare_npm_tag_arg |
| 116 | + uses: actions/github-script@v8 |
| 117 | + env: |
| 118 | + NPM_TAG: ${{ inputs.npm_tag }} |
| 119 | + with: |
| 120 | + # language=javascript |
| 121 | + script: | |
| 122 | + if (!process.env.NPM_TAG || typeof process.env.NPM_TAG !== 'string') { |
| 123 | + return ''; |
| 124 | + } |
| 125 | +
|
| 126 | + if (process.env.NPM_TAG === 'latest') { |
| 127 | + throw new Error('npm_tag cannot be set to "latest" for snapshot releases!'); |
| 128 | + } |
| 129 | +
|
| 130 | + return `--tag ${process.env.NPM_TAG}`; |
| 131 | + result-encoding: string |
110 | 132 | - name: Release |
111 | | - 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 }} |
| 133 | + 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 }} |
112 | 134 | release_official: |
113 | 135 | name: Create an official release |
114 | 136 | runs-on: ubuntu-latest |
@@ -158,5 +180,18 @@ jobs: |
158 | 180 | } |
159 | 181 | return `--workspaces ${process.env.WORKSPACES.split(',').join(' ')}`; |
160 | 182 | result-encoding: string |
| 183 | + - name: Prepare npm tag |
| 184 | + id: prepare_npm_tag_arg |
| 185 | + uses: actions/github-script@v8 |
| 186 | + env: |
| 187 | + NPM_TAG: ${{ inputs.npm_tag }} |
| 188 | + with: |
| 189 | + # language=javascript |
| 190 | + script: | |
| 191 | + if (!process.env.NPM_TAG || typeof process.env.NPM_TAG !== 'string') { |
| 192 | + return ''; |
| 193 | + } |
| 194 | + return `--tag ${process.env.NPM_TAG}`; |
| 195 | + result-encoding: string |
161 | 196 | - name: Release |
162 | | - 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 }} |
| 197 | + 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 }} |
0 commit comments