[ci] Fix --dry not being passed correctly (#32489)
Boolean params for dry runs are true if the param exists at all, so only add it if we're in dry run mode.
lauren committed
Feb 27, 2025 at 16:01 UTC
5eb20b3007a8fafaf032c2e028c335ab09217d9f
1 file changed
+19
-23
.github/workflows/runtime_releases_from_npm_manual.yml
+19
-23
@@ -50,7 +50,7 @@ jobs:
50
embed-author-name: ${{ github.event.sender.login }}
51
embed-author-url: ${{ github.event.sender.html_url }}
52
embed-author-icon-url: ${{ github.event.sender.avatar_url }}
53
- embed-title: '⚠️ Publishing release from NPM'
53
+ embed-title: "⚠️ Publishing release from NPM${{ inputs.dry && ' (dry run)' }}"
54
embed-description: |
55
```json
56
${{ toJson(inputs) }}
@@ -80,44 +80,40 @@ jobs:
80
working-directory: scripts/release
81
- run: cp ./scripts/release/ci-npmrc ~/.npmrc
82
- if: '${{ inputs.only_packages }}'
83
- name: 'Prepare and publish ${{ inputs.only_packages }}'
83
+ name: 'Prepare ${{ inputs.only_packages }} from NPM'
84
run: |
85
- echo -e "===== Preparing release from NPM =====\n"
85
scripts/release/prepare-release-from-npm.js \
86
--ci \
87
--skipTests \
88
--version=${{ inputs.version_to_promote }} \
89
--publishVersion=${{ inputs.version_to_publish }} \
90
--onlyPackages=${{ inputs.only_packages }}
92
-
93
- echo -e "\n\n===== Check prepared files =====\n"
94
- ls -R build/node_modules
95
-
96
- echo -e "\n\n===== Publishing to NPM =====\n"
97
- scripts/release/publish.js \
98
- --ci \
99
- --tags=${{ inputs.tags }} \
100
- --publishVersion=${{ inputs.version_to_publish }} \
101
- --onlyPackages=${{ inputs.only_packages }} \
102
- --dry=${{ inputs.dry }}
91
- if: '${{ inputs.skip_packages }}'
104
- name: 'Prepare and publish all packages EXCEPT ${{ inputs.skip_packages }}'
92
+ name: 'Prepare all packages EXCEPT ${{ inputs.skip_packages }} from NPM'
93
run: |
106
- echo -e "===== Preparing release from NPM =====\n"
94
scripts/release/prepare-release-from-npm.js \
95
--ci \
96
--skipTests \
97
--version=${{ inputs.version_to_promote }} \
98
--publishVersion=${{ inputs.version_to_publish }} \
99
--skipPackages=${{ inputs.skip_packages }}
113
-
114
- echo -e "\n\n===== Check prepared files =====\n"
115
- ls -R build/node_modules
116
-
117
- echo -e "\n\n===== Publishing to NPM =====\n"
100
+ - name: Check prepared files
101
+ run: ls -R build/node_modules
102
+ - if: '${{ inputs.only_packages }}'
103
+ name: 'Publish ${{ inputs.only_packages }}'
104
+ run: |
105
+ scripts/release/publish.js \
106
+ --ci \
107
+ --tags=${{ inputs.tags }} \
108
+ --publishVersion=${{ inputs.version_to_publish }} \
109
+ --onlyPackages=${{ inputs.only_packages }} ${{ (inputs.dry && '') || '\'}}
110
+ ${{ inputs.dry && '--dry'}}
111
+ - if: '${{ inputs.skip_packages }}'
112
+ name: 'Publish all packages EXCEPT ${{ inputs.skip_packages }}'
113
+ run: |
114
scripts/release/publish.js \
115
--ci \
116
--tags=${{ inputs.tags }} \
117
--publishVersion=${{ inputs.version_to_publish }} \
122
- --skipPackages=${{ inputs.skip_packages }} \
123
- --dry=${{ inputs.dry }}
118
+ --skipPackages=${{ inputs.skip_packages }} ${{ (inputs.dry && '') || '\'}}
119
+ ${{ inputs.dry && '--dry'}}