v3.0.0 #9
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: release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v2 | |
- name: Setup Node.js 22 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 22 | |
- name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm ci | |
- name: Build package | |
run: npm run build | |
- name: Authenticate to npm | |
run: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> ~/.npmrc | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Publish package to npm | |
run: npm publish --access public | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: Publish package to GitHub Packages | |
run: npm publish --registry=https://npm.pkg.github.com/ | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist |