Skip to content

chore: version packages (#7) #12

chore: version packages (#7)

chore: version packages (#7) #12

Workflow file for this run

name: Publish Package
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Build
run: npm run build
# Configure npm registry for publishing
- name: Setup Node.js for npm
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
title: 'chore: version packages'
commit: 'chore: version packages'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Only publish to GitHub Packages if npm publish succeeded
- name: Setup Node.js for GitHub Packages
if: steps.changesets.outputs.published == 'true'
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@taskade'
- name: Publish to GitHub Packages
if: steps.changesets.outputs.published == 'true'
run: npm publish --registry=https://npm.pkg.github.com --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}