Skip to content

Commit cced945

Browse files
jddunnclaude
andcommitted
feat: automate releases with semantic-release
- Replace manual release workflow with semantic-release automation - Releases triggered by Conventional Commits (feat: → minor, fix: → patch) - Remove redundant release-on-tag.yml workflow - Update release.config.js with enhanced rules - Update docs/RELEASING.md with new process 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d67005f commit cced945

4 files changed

Lines changed: 172 additions & 271 deletions

File tree

.github/workflows/release-on-tag.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 32 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,71 @@
11
name: Release
22

3-
# MANUAL RELEASE ONLY - prevents accidental version bumps
4-
# To release: Actions → Release → Run workflow → Enter version
3+
# Automatic releases on push to master based on Conventional Commits
4+
# - feat: commits trigger minor version bump
5+
# - fix: commits trigger patch version bump
6+
# - feat!: or BREAKING CHANGE: trigger major version bump
7+
# - docs:, chore:, ci:, test: commits don't trigger releases
58

69
on:
10+
push:
11+
branches:
12+
- master
713
workflow_dispatch:
814
inputs:
9-
version:
10-
description: 'Release version (e.g., 0.1.1, 0.2.0, 1.0.0)'
11-
required: true
12-
type: string
1315
dry_run:
14-
description: 'Dry run (no publish)'
16+
description: 'Dry run (analyze but do not publish)'
1517
required: false
1618
type: boolean
1719
default: false
1820

1921
jobs:
2022
release:
21-
name: Publish to npm
23+
name: Semantic Release
2224
runs-on: ubuntu-latest
25+
# Only run if CI passes (this job depends on CI implicitly via branch protection)
2326
permissions:
2427
contents: write
28+
issues: write
29+
pull-requests: write
2530
id-token: write
31+
2632
steps:
27-
- uses: actions/checkout@v4
33+
- name: Checkout
34+
uses: actions/checkout@v4
2835
with:
2936
fetch-depth: 0
37+
persist-credentials: false
3038

31-
- name: Validate version format
32-
run: |
33-
if [[ ! "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
34-
echo "Error: Invalid version format. Use semver (e.g., 0.1.1, 0.2.0-beta.1)"
35-
exit 1
36-
fi
37-
38-
- name: Set up Node.js
39+
- name: Setup Node.js
3940
uses: actions/setup-node@v4
4041
with:
4142
node-version: '20'
4243
registry-url: 'https://registry.npmjs.org'
4344

44-
- name: Install PNPM
45-
uses: pnpm/action-setup@v2
45+
- name: Setup pnpm
46+
uses: pnpm/action-setup@v4
4647
with:
47-
version: 9
48+
version: 10
4849

4950
- name: Install dependencies
5051
run: pnpm install
5152

5253
- name: Build
53-
run: pnpm run build
54+
run: pnpm build
5455

5556
- name: Test
56-
run: pnpm run test
57+
run: pnpm test
5758

58-
- name: Update version in package.json
59-
run: |
60-
npm version ${{ inputs.version }} --no-git-tag-version
61-
echo "Updated to version ${{ inputs.version }}"
62-
63-
- name: Publish to npm
64-
if: ${{ !inputs.dry_run }}
59+
- name: Semantic Release (Dry Run)
60+
if: ${{ github.event.inputs.dry_run == 'true' }}
6561
env:
66-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
67-
run: npm publish --access public
68-
69-
- name: Dry run - would publish
70-
if: ${{ inputs.dry_run }}
71-
run: |
72-
echo "DRY RUN - Would publish version ${{ inputs.version }}"
73-
npm pack --dry-run
74-
75-
- name: Create git tag
76-
if: ${{ !inputs.dry_run }}
77-
run: |
78-
git config user.name "github-actions[bot]"
79-
git config user.email "github-actions[bot]@users.noreply.github.com"
80-
git add package.json
81-
git commit -m "chore(release): ${{ inputs.version }}"
82-
git tag -a "v${{ inputs.version }}" -m "Release v${{ inputs.version }}"
83-
git push origin HEAD:master --tags
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
64+
run: npx semantic-release --dry-run
8465

85-
- name: Create GitHub Release
86-
if: ${{ !inputs.dry_run }}
87-
uses: softprops/action-gh-release@v1
88-
with:
89-
tag_name: "v${{ inputs.version }}"
90-
name: "@framers/agentos v${{ inputs.version }}"
91-
body: |
92-
## @framers/agentos v${{ inputs.version }}
93-
94-
Install:
95-
```bash
96-
npm install @framers/agentos@${{ inputs.version }}
97-
```
98-
99-
[View on npm](https://www.npmjs.com/package/@framers/agentos/v/${{ inputs.version }})
100-
draft: false
101-
prerelease: ${{ contains(inputs.version, '-') }}
66+
- name: Semantic Release
67+
if: ${{ github.event.inputs.dry_run != 'true' }}
10268
env:
10369
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
71+
run: npx semantic-release

0 commit comments

Comments
 (0)