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
on: | |
release: | |
types: [prereleased] | |
# publish workflow: | |
# 1. create a release https://github.com/Simple-JWT/sjwt/releases/new | |
# 2. mark it as a pre-release which will trigger this script | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- run: npm ci | |
- run: npm run check-version ${GITHUB_REF_NAME} | |
- run: npm run test | |
- run: npm run build | |
- uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set release to latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.GITHUB_REF_NAME }} | |
run: | | |
gh release edit "$tag" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--latest |