Skip to content

Node.js Publish

Node.js Publish #3

Workflow file for this run

name: Node.js Publish
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Log version
run: |
echo "SemVer: ${{ steps.gitversion.outputs.semVer }}"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
always-auth: true
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: ${{ secrets.DG_NEXUS_NPM_URL }}
scope: '@directive'
- name: Install dependencies
run: npm ci
- name: Set version
run: npm version --no-git-tag-version ${{ steps.gitversion.outputs.semVer }}
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.DG_NEXUS_NPM_TOKEN }}