Skip to content

Commit 02a290f

Browse files
committed
feat: switch to semantic-release for automated versioning and publishing
1 parent 375b449 commit 02a290f

3 files changed

Lines changed: 22 additions & 20 deletions

File tree

.github/workflows/publish.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
1-
name: Publish to npm
1+
name: Release
22

33
on:
44
push:
55
branches: [main]
66

77
jobs:
8-
publish:
8+
release:
99
runs-on: ubuntu-latest
1010
permissions:
11-
contents: read
11+
contents: write
1212
id-token: write
13+
issues: write
14+
pull-requests: write
1315
steps:
1416
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1519

1620
- uses: actions/setup-node@v4
1721
with:
1822
node-version: 20
1923
registry-url: https://registry.npmjs.org
2024

21-
- name: Check if version already published
22-
id: check
23-
run: |
24-
PACKAGE_NAME=$(node -p "require('./package.json').name")
25-
PACKAGE_VERSION=$(node -p "require('./package.json').version")
26-
if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version 2>/dev/null; then
27-
echo "skip=true" >> "$GITHUB_OUTPUT"
28-
echo "${PACKAGE_NAME}@${PACKAGE_VERSION} already published, skipping."
29-
else
30-
echo "skip=false" >> "$GITHUB_OUTPUT"
31-
echo "Publishing ${PACKAGE_NAME}@${PACKAGE_VERSION}"
32-
fi
33-
34-
- name: Publish
35-
if: steps.check.outputs.skip != 'true'
36-
run: npm publish --provenance --access public
25+
- name: Release
26+
run: npx semantic-release
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
NPM_CONFIG_PROVENANCE: true

.releaserc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/npm",
7+
"@semantic-release/github"
8+
]
9+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-claude-memory",
3-
"version": "0.1.0",
3+
"version": "0.0.0-semantically-released",
44
"type": "module",
55
"description": "Cross-session memory plugin for OpenCode — Claude Code compatible, persistent, file-based memory",
66
"main": "src/index.ts",

0 commit comments

Comments
 (0)