Skip to content

Publish on Version Change #7

Publish on Version Change

Publish on Version Change #7

Workflow file for this run

name: Publish on Version Change
on:
push:
branches:
- main
paths:
- 'package.json'
- 'packages/**/package.json'
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://npm.pkg.github.com/'
scope: '@adaptate'
# - name: Configure .npmrc for GitHub Packages
# run: |
# echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
# echo "@adaptate:registry=https://npm.pkg.github.com" >> ~/.npmrc
- name: Install dependencies
run: npm ci
- name: Build project
run: npx turbo run build
- name: Publish to GitHub Packages
working-directory: packages/core
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish --registry=https://npm.pkg.github.com/
- name: Publish to npm
working-directory: packages/core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --registry=https://registry.npmjs.org/ --access public