Publish #733
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |