v0.1.82 🌈 #201
Workflow file for this run
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
name: '🧨 Publish Package to npmjs' | |
on: | |
release: | |
types: [released] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: '📦 Installing dependencies' | |
run: yarn --frozen-lockfile | |
- name: '🏗 Build package' | |
run: yarn build | |
- name: '📏 Run unit tests' | |
run: yarn test | |
- name: '🧳 Prepare .npmrc' | |
run: cp .npmrc.template .npmrc | |
- name: '🚀 Publish to npm' | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//') | |
echo "Publishing version $VERSION to npm..." | |
yarn publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} |