Skip to content

Commit

Permalink
Merge pull request #248 from platformsh/update-github-workflow
Browse files Browse the repository at this point in the history
Add a new workflow to release beta on npm when tag contains '-beta'
  • Loading branch information
tlattimore authored Jun 5, 2023
2 parents 4fb8d87 + 6e83198 commit 77e50ac
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/publish-npm.yml
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 }}

0 comments on commit 77e50ac

Please sign in to comment.