Skip to content

Commit 9232b0f

Browse files
authored
add release workflow (#13)
add release workflow add usage
2 parents a28a02c + 34f483c commit 9232b0f

3 files changed

Lines changed: 74 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: oven-sh/setup-bun@v2
15+
16+
- run: bun install
17+
18+
- run: bun run typecheck
19+
20+
- run: bun run build
21+
22+
- run: npm publish --access public
23+
env:
24+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-supermemory",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "OpenCode plugin that gives coding agents persistent memory using Supermemory",
55
"type": "module",
66
"main": "dist/index.js",

scripts/release.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
#
3+
# Release script for opencode-supermemory
4+
#
5+
# Usage:
6+
# ./scripts/release.sh [patch|minor|major]
7+
#
8+
# Examples:
9+
# ./scripts/release.sh patch # 0.1.4 → 0.1.5
10+
# ./scripts/release.sh minor # 0.1.4 → 0.2.0
11+
# ./scripts/release.sh major # 0.1.4 → 1.0.0
12+
#
13+
# After running, push to trigger the GitHub Actions release workflow:
14+
# git push && git push --tags
15+
#
16+
# Prerequisites:
17+
# - jq installed
18+
# - NPM_TOKEN secret configured in GitHub repo settings
19+
#
20+
set -e
21+
22+
BUMP_TYPE="${1:-patch}"
23+
24+
if [[ ! "$BUMP_TYPE" =~ ^(patch|minor|major)$ ]]; then
25+
echo "usage: ./scripts/release.sh [patch|minor|major]"
26+
exit 1
27+
fi
28+
29+
CURRENT_VERSION=$(jq -r .version package.json)
30+
echo "current version: $CURRENT_VERSION"
31+
32+
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
33+
case "$BUMP_TYPE" in
34+
major) NEW_VERSION="$((MAJOR + 1)).0.0" ;;
35+
minor) NEW_VERSION="$MAJOR.$((MINOR + 1)).0" ;;
36+
patch) NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" ;;
37+
esac
38+
39+
echo "new version: $NEW_VERSION"
40+
41+
jq ".version = \"$NEW_VERSION\"" package.json > package.json.tmp && mv package.json.tmp package.json
42+
43+
git add package.json
44+
git commit -m "v$NEW_VERSION"
45+
git tag "v$NEW_VERSION"
46+
47+
echo ""
48+
echo "created commit and tag v$NEW_VERSION"
49+
echo "run 'git push && git push --tags' to trigger release"

0 commit comments

Comments
 (0)