Skip to content

Commit 69b4cb8

Browse files
authored
[ci] Allow dry run (facebook#34765)
Allow running the compiler release script as dry run.
1 parent a664f5f commit 69b4cb8

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.github/workflows/compiler_prereleases.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
tag_version:
2020
required: false
2121
type: string
22+
dry_run:
23+
required: false
24+
type: boolean
2225
secrets:
2326
NPM_TOKEN:
2427
required: true
@@ -55,7 +58,13 @@ jobs:
5558
key: compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/yarn.lock') }}
5659
- run: yarn install --frozen-lockfile
5760
if: steps.node_modules.outputs.cache-hit != 'true'
58-
- name: Publish packages to npm
61+
- if: inputs.dry_run == true
62+
name: Publish packages to npm (dry run)
63+
run: |
64+
cp ./scripts/release/ci-npmrc ~/.npmrc
65+
scripts/release/publish.js --ci --versionName=${{ inputs.version_name }} --tag=${{ inputs.dist_tag }} ${{ inputs.tag_version && format('--tagVersion={0}', inputs.tag_version) || '' }}
66+
- if: inputs.dry_run != true
67+
name: Publish packages to npm
5968
run: |
6069
cp ./scripts/release/ci-npmrc ~/.npmrc
6170
scripts/release/publish.js --frfr --ci --versionName=${{ inputs.version_name }} --tag=${{ inputs.dist_tag }} ${{ inputs.tag_version && format('--tagVersion={0}', inputs.tag_version) || '' }}

.github/workflows/compiler_prereleases_manual.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
tag_version:
1818
required: false
1919
type: string
20+
dry_run:
21+
required: false
22+
type: boolean
2023

2124
permissions: {}
2225

@@ -33,5 +36,6 @@ jobs:
3336
dist_tag: ${{ inputs.dist_tag }}
3437
version_name: ${{ inputs.version_name }}
3538
tag_version: ${{ inputs.tag_version }}
39+
dry_run: ${{ inputs.dry_run }}
3640
secrets:
3741
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/compiler_prereleases_nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ jobs:
1919
release_channel: experimental
2020
dist_tag: experimental
2121
version_name: '0.0.0'
22+
dry_run: false
2223
secrets:
2324
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)