Skip to content

Release & Publish to NPM #45

Release & Publish to NPM

Release & Publish to NPM #45

name: 'Release & Publish to NPM'
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: Install the dependencies
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
- name: Initialize Git user
run: |
git config --global user.email "azeezat94@gmail.com"
git config --global user.name "Release Workflow"
- name: Initialize npm config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release
run: npm run release --ci
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: End Message
run: echo "All done"