Skip to content
name: Publish package to GitHub Packages
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@triax'
- run: npm ci
- name: Increment version
run: npm run increment-version
- name: Push new version
run: |
git config --global user.name "Ayanel CI"
git config --global user.email "otiai10+ayanel-ci@gmail.com"
git add package.json package-lock.json
echo ${{ github.actor }}
echo ${{ github.repository }}
git commit -m "Bump version"
git push
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}