Update and rename npm-publish.yml to release-publish.yml #1
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: Release publish | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: write | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://npm.pkg.github.com | |
scope: "@msobiecki" | |
- name: Run version bump | |
id: changelog | |
uses: TriPSs/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
skip-on-empty: false | |
- name: Run release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.changelog.outputs.tag }} | |
release_name: ${{ steps.changelog.outputs.tag }} | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
- name: Install dependencies | |
run: npm ci | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run publish | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
registry: https://npm.pkg.github.com/ | |
token: ${{ secrets.GITHUB_TOKEN }} |