v1.2.1 #8
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 | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
name: Build and publish to npm | |
steps: | |
- name: Check actor permission level | |
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1 | |
with: | |
require: admin | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Read package.json node and npm engines version | |
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 | |
id: versions | |
with: | |
fallbackNode: '^20' | |
fallbackNpm: '^9' | |
- name: Set up node ${{ steps.versions.outputs.nodeVersion }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ steps.versions.outputs.nodeVersion }} | |
- name: Set up npm ${{ steps.versions.outputs.npmVersion }} | |
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}" | |
- name: Install dependencies & build | |
env: | |
CYPRESS_INSTALL_BINARY: 0 | |
run: | | |
npm i | |
npm run build:lib | |
- name: Publish | |
run: | | |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Setup Github Package Registry | |
uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Publish package on GPR | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |