Skip to content

Publish

Publish #2

Workflow file for this run

name: Publish
on:
workflow_dispatch:
jobs:
publish:
name: Publish
if: github.repository == 'dcodeIO/bcrypt.js'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: current
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
VERSION=$(npx aspublish --version)
if [ -z "$VERSION" ]; then
echo "Changes do not trigger a release"
else
echo "Publishing new version: $VERSION"
npx aspublish
fi