Skip to content

chore(release): 2.0.8 #16

chore(release): 2.0.8

chore(release): 2.0.8 #16

Workflow file for this run

name: Release to npm
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
if: ${{ !startsWith(github.event.head_commit.message, 'chore(release):') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.AGENT_TOKEN || github.token }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run test -- --passWithNoTests
- name: Compile skills
run: npm run compile
- name: Validate compiled skills
run: npm run compile:validate
- name: Configure git author
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Bump patch version
id: version
run: |
CURRENT_VERSION=$(node -p "require('./package.json').version")
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
NEXT_PATCH=$((PATCH + 1))
NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}"
while git show-ref --verify --quiet "refs/tags/v${NEXT_VERSION}"; do
NEXT_PATCH=$((NEXT_PATCH + 1))
NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}"
done
npm version "$NEXT_VERSION" -m "chore(release): %s"
echo "version=$NEXT_VERSION" >> "$GITHUB_OUTPUT"
- name: Push release commit and tag
run: git push --follow-tags
env:
GITHUB_TOKEN: ${{ secrets.AGENT_TOKEN || github.token }}
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.AGENT_NPM_TOKEN }}