Skip to content

publish-npm

publish-npm #63

Workflow file for this run

name: publish-npm
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11
- uses: actions/setup-node@v1
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
with:
node-version: '25'
registry-url: https://registry.npmjs.org/
scope: '@mat-github-ci'
- name: Install dependencies
run: |
npm i
- name: Build project
run: |
npm run build-publish
- name: Publish to NPM
run: |
echo Publishing to test repo $NODE_AUTH_TOKEN
VERSION=$(node -p "require('./package.json').version")
if [[ "$VERSION" == *"-rc"* ]]; then
npm publish --tag rc
else
npm publish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}