ci(dotfiles): 🐛 use Node.js version 20.x for building and Node.js… #42
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 | |
env: | |
MY_NPM_REGISTRY: https://registry.npmjs.org | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 7 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: ${{ env.MY_NPM_REGISTRY }} | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm run build | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2.2.4 | |
with: | |
version: 7 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 21.x | |
registry-url: ${{ env.MY_NPM_REGISTRY }} | |
- run: pnpm install --frozen-lockfile # Only if necessary | |
- name: Publish to NPM | |
run: pnpm publish --access public --tag latest --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Configure for GitHub Package Registry | |
run: | | |
pnpm config set registry https://npm.pkg.github.com | |
pnpm set //npm.pkg.github.com/:_authToken ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish the package to GitHub Package Registry | |
run: pnpm publish --access public --tag latest --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |