Skip to content

Commit

Permalink
Update publish-npm.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shakaman committed Jun 14, 2023
1 parent b3980af commit 5485ae1
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ on:
- v0.*

jobs:
publish:
if: { github.ref == 'refs/heads/master' }
publish-version:
name: Publish new npm version
if: github.ref == 'refs/heads/master' && ${{ !endsWith(github.ref, '-beta') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -17,15 +18,23 @@ jobs:
- run: yarn
- run: yarn test
- run: yarn build

- name: Beta
if: ${{ endsWith(github.ref, '-beta') }}
run: yarn publish --tag beta
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Current version
if: ${{ !endsWith(github.ref, '-beta') }}
run: yarn publish
publish-beta:
name: Publish new npm beta version
if: ${{ endsWith(github.ref, '-beta') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn test
- run: yarn build
- run: yarn publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 5485ae1

Please sign in to comment.