Skip to content

Publish Package to GitHub Packages #15

Publish Package to GitHub Packages

Publish Package to GitHub Packages #15

Workflow file for this run

name: Publish Package to GitHub Packages
on:
# push:
# branches:
# - master
# Lets keep it manual for now
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: 'https://npm.pkg.github.com'
scope: '@${{ github.repository_owner }}'
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
- name: Clear npm cache
run: npm cache clean --force
- name: Bump version
run: npm version patch
- name: Install dependencies
run: npm ci --verbose
- name: Run lint
run: npm run lint
- name: Run tests
run: npm test
- name: Build
run: npm run build
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit version bump
run: |
git add .
git commit -m 'ci: bump version'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}