Skip to content

Commit

Permalink
chore: create a reusable release workflow file (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Oct 18, 2023
1 parent e7e3959 commit 6adb111
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/reusable-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Reusable Release Workflow

on:
workflow_call:
secrets:
NODE_AUTH_TOKEN:
required: true

env:
CI: true
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare for publication to npm
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"
cache: npm
- run: npm ci
- if: ${{ contains(github.ref_name, 'beta') }}
run: npm publish --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- if: ${{ contains(github.ref_name, 'alpha') }}
run: npm publish --access public --tag alpha
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- if: ${{ !contains(github.ref_name, 'alpha') && !contains(github.ref_name, 'beta') }}
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

0 comments on commit 6adb111

Please sign in to comment.