Skip to content

Commit d842408

Browse files
authored
ci: update non-prod build base version number + dry-run option
1 parent 7c4205d commit d842408

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
description: 'Skip Tests'
1616
required: true
1717
type: boolean
18+
dryrun:
19+
description: 'Dry Run'
20+
required: true
21+
type: boolean
1822
summary:
1923
description: 'Summary'
2024
required: false
@@ -39,23 +43,23 @@ jobs:
3943
fetch-depth: 0
4044

4145
- name: Get Next Version
42-
if: ${{ github.event.inputs.publish == 'true' }}
46+
if: ${{ github.event.inputs.publish == 'true' || github.event.inputs.dryrun == 'true' }}
4347
id: semver
4448
uses: ietf-tools/semver-action@v1
4549
with:
4650
token: ${{ github.token }}
4751
branch: main
4852

4953
- name: Set Next Version Env Var
50-
if: ${{ github.event.inputs.publish == 'true' }}
54+
if: ${{ github.event.inputs.publish == 'true' || github.event.inputs.dryrun == 'true' }}
5155
env:
5256
NEXT_VERSION: ${{ steps.semver.outputs.next }}
5357
run: |
5458
echo "NEXT_VERSION=$next" >> $GITHUB_ENV
5559
5660
- name: Create Draft Release
5761
uses: ncipollo/release-action@v1
58-
if: ${{ github.event.inputs.publish == 'true' }}
62+
if: ${{ github.event.inputs.publish == 'true' && github.event.inputs.dryrun == 'false' }}
5963
with:
6064
prerelease: true
6165
draft: false
@@ -81,10 +85,10 @@ jobs:
8185
echo "::set-output name=pkg_version_strict::${GITHUB_REF_NAME#?}"
8286
echo "::notice::Release created using tag $GITHUB_REF_NAME"
8387
else
84-
echo "Using TEST mode: v7.0.0-dev.$GITHUB_RUN_NUMBER"
88+
echo "Using TEST mode: v8.0.0-dev.$GITHUB_RUN_NUMBER"
8589
echo "::set-output name=should_deploy::false"
86-
echo "::set-output name=pkg_version::v7.0.0-dev.$GITHUB_RUN_NUMBER"
87-
echo "::set-output name=pkg_version_strict::7.0.0-dev.$GITHUB_RUN_NUMBER"
90+
echo "::set-output name=pkg_version::v8.0.0-dev.$GITHUB_RUN_NUMBER"
91+
echo "::set-output name=pkg_version_strict::8.0.0-dev.$GITHUB_RUN_NUMBER"
8892
echo "::notice::Non-production build created using branch $GITHUB_REF_NAME"
8993
fi
9094
@@ -151,7 +155,7 @@ jobs:
151155
# -----------------------------------------------------------------
152156
release:
153157
name: Make Release
154-
if: ${{ always() }}
158+
if: ${{ always() && github.event.inputs.dryrun == 'false' }}
155159
needs: [tests, prepare]
156160
runs-on: ubuntu-latest
157161
env:
@@ -229,7 +233,7 @@ jobs:
229233

230234
- name: Create Release
231235
uses: ncipollo/release-action@v1
232-
if: env.SHOULD_DEPLOY == 'true'
236+
if: ${{ env.SHOULD_DEPLOY == 'true' && github.event.inputs.dryrun == 'false' }}
233237
with:
234238
allowUpdates: true
235239
draft: false

0 commit comments

Comments
 (0)