Skip to content

chore(git-chimp): bump to 0.3.2 #83

chore(git-chimp): bump to 0.3.2

chore(git-chimp): bump to 0.3.2 #83

Workflow file for this run

name: Release Monorepo Packages
on:
push:
branches:
- main
tags:
- '@chimp-stack/*@*' # Triggers only on scoped version tags
permissions:
contents: write
jobs:
release:
name: Build and Publish ${{ matrix.package }}
runs-on: ubuntu-latest
strategy:
matrix:
package:
- chimp-core
- git-chimp
- doc-chimp
- release-chimp
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for tag detection
- uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
- name: Configure npm auth
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install dependencies
run: npm ci
- name: Build and Publish if New
working-directory: packages/${{ matrix.package }}
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
CURRENT_VERSION=$(node -p "require('./package.json').version")
PUBLISHED_VERSION=$(npm view $PACKAGE_NAME version || echo "0.0.0")
echo "πŸ“¦ Package: $PACKAGE_NAME"
echo "πŸ”– Current Version: $CURRENT_VERSION"
echo "πŸ“¬ Published Version: $PUBLISHED_VERSION"
if [ "$CURRENT_VERSION" = "$PUBLISHED_VERSION" ]; then
echo "⏩ Skipping β€” already published."
exit 0
fi
echo "πŸ”¨ Building $PACKAGE_NAME..."
npm run build
echo "πŸš€ Publishing $PACKAGE_NAME@$CURRENT_VERSION..."
npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}