Skip to content

New version

New version #170

Workflow file for this run

# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- run: npm run ci
- name: Publish to NPM if version in package.json has changed
id: publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
provenance: true
- name: Create tag
if: steps.publish.outputs.type
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ steps.publish.outputs.version }}',
sha: context.sha
})
- name: Create a Github Release when a version was published
if: steps.publish.outputs.type
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.publish.outputs.version }}
name: v${{ steps.publish.outputs.version }}
makeLatest: true
permissions:
id-token: write
contents: write