-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from platformsh/update-github-workflow
Add a new workflow to release beta on npm when tag contains '-beta'
- Loading branch information
Showing
1 changed file
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
name: Publish npm | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v0.** | ||
- 'v0.**' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: yarn | ||
- run: npm test | ||
- run: npm run build | ||
- uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- run: yarn test | ||
- run: yarn build | ||
|
||
- name: Beta | ||
if: ${{ contains(github.ref, '-beta') }} | ||
run: yarn publish --tag beta | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Current version | ||
if: ${{ !contains(github.ref, '-beta') }} | ||
run: yarn publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |