Skip to content

Node.js Package

Node.js Package #62

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
on:
push:
tags:
- v*
jobs:
publish-npm:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'source'
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Copy README.md to source
run: |
pwd
cp ../README.md ./
- run: npm ci
- name: Publish npm package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_API_TOKEN}}
gh-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: debug
run: |
echo "${{ contains(github.ref_name, 'dev') }}"
- name: Release
uses: softprops/action-gh-release@v1
# if: "!startsWith(github.ref_name, 'v-test-')"
with:
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, 'dev') }}