Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2

- run: bun install

- run: bun run typecheck

- run: bun run build

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opencode-supermemory",
"version": "0.1.4",
"version": "0.1.5",
"description": "OpenCode plugin that gives coding agents persistent memory using Supermemory",
"type": "module",
"main": "dist/index.js",
Expand Down
49 changes: 49 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
#
# Release script for opencode-supermemory
#
# Usage:
# ./scripts/release.sh [patch|minor|major]
#
# Examples:
# ./scripts/release.sh patch # 0.1.4 → 0.1.5
# ./scripts/release.sh minor # 0.1.4 → 0.2.0
# ./scripts/release.sh major # 0.1.4 → 1.0.0
#
# After running, push to trigger the GitHub Actions release workflow:
# git push && git push --tags
#
# Prerequisites:
# - jq installed
# - NPM_TOKEN secret configured in GitHub repo settings
#
set -e

BUMP_TYPE="${1:-patch}"

if [[ ! "$BUMP_TYPE" =~ ^(patch|minor|major)$ ]]; then
echo "usage: ./scripts/release.sh [patch|minor|major]"
exit 1
fi

CURRENT_VERSION=$(jq -r .version package.json)
echo "current version: $CURRENT_VERSION"

IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
case "$BUMP_TYPE" in
major) NEW_VERSION="$((MAJOR + 1)).0.0" ;;
minor) NEW_VERSION="$MAJOR.$((MINOR + 1)).0" ;;
patch) NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" ;;
esac

echo "new version: $NEW_VERSION"

jq ".version = \"$NEW_VERSION\"" package.json > package.json.tmp && mv package.json.tmp package.json

git add package.json
git commit -m "v$NEW_VERSION"
git tag "v$NEW_VERSION"

echo ""
echo "created commit and tag v$NEW_VERSION"
echo "run 'git push && git push --tags' to trigger release"