Skip to content

Commit 75c7789

Browse files
committed
chore: add release workflow (semantic-release) on master
1 parent dd91f2c commit 75c7789

5 files changed

Lines changed: 122 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
issues: read
11+
pull-requests: read
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
registry-url: 'https://registry.npmjs.org'
30+
cache: 'pnpm'
31+
32+
- name: Install
33+
run: pnpm install --no-frozen-lockfile
34+
35+
- name: Build
36+
run: pnpm run build
37+
38+
- name: Release
39+
run: npx semantic-release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
143
name: Release & Publish
244

345
on:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented here automatically by semantic-release.
4+

RELEASING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# AgentOS Extensions Release Workflow
2+
3+
This package publishes to npm via [semantic-release](https://semantic-release.gitbook.io) and GitHub Actions.
4+
5+
## Branch flow
6+
7+
- `master` is the canonical release branch.
8+
- Each merge to `master` triggers `.github/workflows/release.yml`.
9+
- Commits must follow the [Conventional Commits](https://conventionalcommits.org) syntax so semantic-release can derive the correct version bump.
10+
- If there are no `feat`/`fix` (or breaking) commits since the previous release, the workflow exits without publishing.
11+
12+
## What the workflow does
13+
14+
1. Installs dependencies (`pnpm install`).
15+
2. Runs `pnpm run build` to ensure all curated registries compile.
16+
3. Executes `semantic-release`, which:
17+
- Calculates the next version.
18+
- Updates `CHANGELOG.md`.
19+
- Publishes a tag/release in GitHub (`vX.Y.Z`).
20+
- Publishes the package to npm.
21+
- Commits the updated changelog & package.json back to `master` as `chore(release): X.Y.Z [skip ci]`.
22+
23+
## Commit → Version mapping
24+
25+
| Commit message | Release |
26+
|-----------------------------------|--------------------------|
27+
| `fix:` | Patch (x.y.z → x.y.z+1) |
28+
| `feat:` | Minor (x.y.z → x.y+1.0) |
29+
| `feat!:`, `fix!:` or `BREAKING CHANGE:` | Major (x.y.z → x+1.0.0) |
30+
| `docs:`, `chore:` (no breaking) | No release |
31+
32+
## Manual invocation
33+
34+
If you need to re-run locally:
35+
36+
```bash
37+
pnpm install
38+
pnpm run build
39+
npx semantic-release --dry-run # inspect
40+
npx semantic-release # publish
41+
```
42+
43+
Run manual releases only from a clean checkout of `master` with the correct `NPM_TOKEN` configured.
44+
45+
## Secrets
46+
47+
- `GITHUB_TOKEN` is provided automatically by GitHub Actions.
48+
- `NPM_TOKEN` must be stored as a repository secret in the submodule (`Settings → Secrets and variables → Actions`).
49+

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@
3030
"author": "Framers AI",
3131
"license": "MIT",
3232
"devDependencies": {
33-
"vitest": "^1.6.0",
33+
"@semantic-release/changelog": "^6.0.3",
34+
"@semantic-release/commit-analyzer": "^13.0.0",
35+
"@semantic-release/git": "^10.0.1",
36+
"@semantic-release/github": "^9.2.4",
37+
"@semantic-release/npm": "^12.0.1",
38+
"@semantic-release/release-notes-generator": "^14.0.1",
39+
"semantic-release": "^24.1.0",
40+
"typedoc": "^0.25.13",
3441
"typescript": "^5.4.5",
35-
"typedoc": "^0.25.13"
42+
"vitest": "^1.6.0"
3643
}
3744
}

release.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
branches: ['master'],
3+
repositoryUrl: 'https://github.com/framersai/agentos-extensions',
4+
tagFormat: 'v${version}',
5+
plugins: [
6+
['@semantic-release/commit-analyzer', { preset: 'conventionalcommits' }],
7+
['@semantic-release/release-notes-generator', { preset: 'conventionalcommits' }],
8+
['@semantic-release/changelog', { changelogFile: 'CHANGELOG.md' }],
9+
['@semantic-release/npm', { npmPublish: true }],
10+
['@semantic-release/github', { assets: [] }],
11+
['@semantic-release/git', {
12+
assets: ['CHANGELOG.md', 'package.json'],
13+
message: 'chore(release): ${nextRelease.version} [skip ci]'
14+
}]
15+
]
16+
};
17+
18+

0 commit comments

Comments
 (0)