Skip to content

Commit a67c1b4

Browse files
authored
chore: release process allow previews (#491)
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent d23a348 commit a67c1b4

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
- alpha
2323
default: rc
2424
required: false
25+
prerelease:
26+
description: "This a pre-release"
27+
type: boolean
28+
default: false
29+
required: false
2530

2631
env:
2732
REPORTS_DIR: CI_reports
@@ -89,12 +94,16 @@ jobs:
8994
- name: install build tools
9095
run: npm ci --ignore-scripts
9196
# no explicit npm build. if a build is required, it should be configured as prepublish/prepublishOnly script of npm.
92-
- name: publish to NPMJS
93-
run: |
94-
npm config set "//registry.npmjs.org/:_authToken=$NPMJS_AUTH_TOKEN"
95-
npm publish --access public
97+
- name: login to NPMJS
98+
run: npm config set "//registry.npmjs.org/:_authToken=$NPMJS_AUTH_TOKEN"
9699
env:
97100
NPMJS_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
101+
- name: publish to NPMJS as "latest"
102+
if: ${{ github.event.inputs.prerelease != 'true' }}
103+
run: npm publish --access public --tag 'latest'
104+
- name: publish to NPMJS as "unstable-prerelease"
105+
if: ${{ github.event.inputs.prerelease == 'true' }}
106+
run: npm publish --access public --tag 'unstable-prerelease'
98107

99108
release-GH:
100109
needs:
@@ -113,6 +122,6 @@ jobs:
113122
env:
114123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115124
with:
116-
tag_name: ${{ needs.bump.outputs.version }}
117-
name: ${{ needs.bump.outputs.version_plain }}
118-
prerelease: ${{ startsWith(github.event.inputs.newversion, 'pre') || contains(github.event.inputs.newversion, 'rc') || contains(github.event.inputs.newversion, 'beta') || contains(github.event.inputs.newversion, 'alpha')}}
125+
tag_name: ${{ needs.bump.outputs.version }}
126+
name: ${{ needs.bump.outputs.version_plain }}
127+
prerelease: ${{ github.event.inputs.prerelease }}

0 commit comments

Comments
 (0)