Skip to content

Implement version management with manual update workflow and scripts … #20

Implement version management with manual update workflow and scripts …

Implement version management with manual update workflow and scripts … #20

# .github/workflows/publish-contract.yml
name: Publish API Contract to GitHub Packages
on:
push:
branches:
- main
paths-ignore:
- 'package.json'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
scope: '@tobenot'
- name: Install dependencies and build
run: |
rm -rf package-lock.json node_modules
npm install
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}