0.10.4-beta-alias #38
Workflow file for this run
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: Autopublish to npm on release creation | |
on: | |
release: | |
types: [published] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.release.target_commitish }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm i | |
- run: git config --global user.name "GitHub CD bot" | |
- run: git config --global user.email "[email protected]" | |
- run: git status | |
- run: npm version ${{ github.event.release.tag_name }} | |
- uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
# use "beta" tag if relevant, otherwise use "latest" | |
tag: ${{ contains(github.event.release.tag_name, 'beta') && 'beta' || 'latest' }} | |
# DISABLED: push to master forbidden in this repo | |
# push the version changes to GitHub | |
# - run: git push | |
# env: | |
# github-token: ${{ secrets.GITHUB_TOKEN }} | |
show-npm-log: | |
runs-on: ubuntu-latest | |
needs: publish | |
# run only if the previous job failed | |
if: failure() | |
steps: | |
- run: echo "NPM Logs Directory:" | |
- run: ls -l /home/runner/.npm/_logs/ | |
- run: echo "Displaying the most recent log:" | |
- run: cat /home/runner/.npm/_logs/*.log |