Skip to content

Publish

Publish #18

Workflow file for this run

name: Publish package to NPM
on:
workflow_dispatch:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Publish package to NPM
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Log update
if: steps.publish.outputs.type != 'none'
run: |
echo Successfully published a new version
echo "${{ steps.publish.outputs.type }} update: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"
github-release:
runs-on: ubuntu-latest
needs: publish
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get package version
run: echo "LATEST_TAG=$(jq -r .version package.json)" >> $GITHUB_ENV
- name: Create Github release
uses: ncipollo/release-action@v1
with:
tag: 'v${{ env.LATEST_TAG }}'
generateReleaseNotes: true