|
1 | 1 | # SimDeck Release Workflow |
2 | 2 | # |
3 | 3 | # Triggered manually from the Actions tab. Picks one package, bumps its version |
4 | | -# locally with `npm version`, commits + tags, builds, and publishes: |
| 4 | +# locally with `npm version` or reuses the current version, commits + tags, |
| 5 | +# builds, and publishes: |
5 | 6 | # - npm packages publish over OIDC trusted publishing (no NPM_TOKEN). |
6 | 7 | # - The VS Code extension publishes via vsce + VSCE_PAT (no OIDC option). |
7 | 8 | # |
|
40 | 41 | - "@nativescript/simdeck-inspector" |
41 | 42 | - simdeck-vscode |
42 | 43 | bump: |
43 | | - description: "Version bump" |
| 44 | + description: "Version bump (use current to publish the checked-in version without bumping)" |
44 | 45 | required: true |
45 | 46 | type: choice |
46 | 47 | default: prerelease |
47 | 48 | options: |
| 49 | + - current |
48 | 50 | - prerelease |
49 | 51 | - patch |
50 | 52 | - minor |
@@ -179,18 +181,25 @@ jobs: |
179 | 181 | set -euo pipefail |
180 | 182 | cd "$PKG_DIR" |
181 | 183 |
|
182 | | - if [[ "$BUMP" == "prerelease" ]]; then |
| 184 | + if [[ "$BUMP" == "current" ]]; then |
| 185 | + version="$(node -p "require('./package.json').version")" |
| 186 | + elif [[ "$BUMP" == "prerelease" ]]; then |
183 | 187 | new="$(npm version prerelease --preid "$PREID" --no-git-tag-version)" |
| 188 | + version="${new#v}" |
184 | 189 | else |
185 | 190 | new="$(npm version "$BUMP" --no-git-tag-version)" |
| 191 | + version="${new#v}" |
186 | 192 | fi |
187 | 193 |
|
188 | | - version="${new#v}" |
189 | 194 | tag="${SLUG}-v${version}" |
190 | 195 |
|
191 | 196 | echo "version=${version}" >> "$GITHUB_OUTPUT" |
192 | 197 | echo "tag=${tag}" >> "$GITHUB_OUTPUT" |
193 | | - echo "Bumped to ${version} (tag ${tag})" |
| 198 | + if [[ "$BUMP" == "current" ]]; then |
| 199 | + echo "Using current version ${version} (tag ${tag})" |
| 200 | + else |
| 201 | + echo "Bumped to ${version} (tag ${tag})" |
| 202 | + fi |
194 | 203 |
|
195 | 204 | - name: Resolve dist-tag |
196 | 205 | id: tag |
@@ -218,8 +227,15 @@ jobs: |
218 | 227 | INPUT_PACKAGE: ${{ inputs.package }} |
219 | 228 | NEW_VERSION: ${{ steps.version.outputs.version }} |
220 | 229 | TAG: ${{ steps.version.outputs.tag }} |
| 230 | + BUMP: ${{ inputs.bump }} |
221 | 231 | run: | |
222 | 232 | set -euo pipefail |
| 233 | + if [[ "$BUMP" == "current" ]]; then |
| 234 | + git tag -f "${TAG}" |
| 235 | + git push --force origin "${TAG}" |
| 236 | + exit 0 |
| 237 | + fi |
| 238 | +
|
223 | 239 | git add "${PKG_DIR}/package.json" |
224 | 240 | if [[ -f "${PKG_DIR}/package-lock.json" ]]; then |
225 | 241 | git add "${PKG_DIR}/package-lock.json" |
|
0 commit comments