Skip to content

Publish

Publish #953

Workflow file for this run

name: Publish
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
publish:
name: Publish
if: github.repository == 'dcodeIO/long.js'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: main
- uses: dcodeIO/setup-node-nvm@master
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