version bump #28
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: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20.x, 22.x] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: install pnpm | |
run: npm install -g pnpm | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm build | |
if: matrix.os == 'ubuntu-latest' | |
- run: pnpm test | |
if: matrix.os == 'ubuntu-latest' | |
- run: npm test | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- name: install pnpm | |
run: npm install -g pnpm | |
- name: Set VERSION variable from tag | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | |
- name: Print version | |
run: echo $VERSION | |
- name: Verify commit exists in origin/main | |
run: | | |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
git branch --remote --contains | grep origin/main | |
- name: Verify that the version exists in package.json | |
run: 'sudo apt-get install -y jq && [[ "$(jq -r ".version" package.json)" == "$VERSION" ]]' | |
- run: pnpm install --frozen-lockfile | |
- run: pnpm build | |
- run: npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: "${{secrets.NPM_AUTH_TOKEN}}" |