Skip to content

Commit e198eb2

Browse files
ci: add Release Please for automated versioning and releases
1 parent b7bf72d commit e198eb2

4 files changed

Lines changed: 43 additions & 31 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
name: Release Please
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
with:
19+
release-type: node

.github/workflows/release.yml

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
- "v*"
77

88
permissions:
9-
contents: write
9+
contents: read
1010
id-token: write
1111

1212
jobs:
13-
release:
13+
publish:
1414
name: Publish to npm
1515
runs-on: ubuntu-latest
1616

@@ -40,33 +40,5 @@ jobs:
4040

4141
- name: Publish to npm
4242
run: npm publish --provenance --access public
43-
44-
- name: Extract changelog entry
45-
id: changelog
46-
run: |
47-
VERSION="${GITHUB_REF_NAME#v}"
48-
NOTES=$(awk "/^## \[${VERSION}\]/{found=1; next} found && /^## \[/{exit} found{print}" CHANGELOG.md)
49-
NOTES="${NOTES}
50-
51-
---
52-
53-
📦 **npm:** https://www.npmjs.com/package/@devtheops/opencode-plugin-otel/v/${VERSION}"
54-
echo "notes<<EOF" >> "$GITHUB_OUTPUT"
55-
echo "$NOTES" >> "$GITHUB_OUTPUT"
56-
echo "EOF" >> "$GITHUB_OUTPUT"
57-
58-
- name: Create GitHub release
59-
uses: actions/github-script@v7
60-
with:
61-
script: |
62-
await github.rest.repos.createRelease({
63-
owner: context.repo.owner,
64-
repo: context.repo.repo,
65-
tag_name: context.ref.replace('refs/tags/', ''),
66-
name: context.ref.replace('refs/tags/', ''),
67-
body: process.env.RELEASE_NOTES,
68-
draft: false,
69-
prerelease: false,
70-
})
7143
env:
72-
RELEASE_NOTES: ${{ steps.changelog.outputs.notes }}
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.2.1"
3+
}

release-please-config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "node",
5+
"package-name": "@devtheops/opencode-plugin-otel",
6+
"changelog-sections": [
7+
{ "type": "feat", "section": "Features" },
8+
{ "type": "fix", "section": "Bug Fixes" },
9+
{ "type": "perf", "section": "Performance Improvements" },
10+
{ "type": "refactor", "section": "Code Refactoring" },
11+
{ "type": "docs", "section": "Documentation" },
12+
{ "type": "ci", "section": "Continuous Integration" },
13+
{ "type": "build", "section": "Build System" },
14+
{ "type": "chore", "section": "Miscellaneous Chores" }
15+
]
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)