mirror of
https://github.com/bendtherules/opencode-multi-model.git
synced 2026-08-18 21:52:11 +00:00
build: add release script
This commit is contained in:
+2
-1
@@ -19,7 +19,8 @@
|
||||
"scripts": {
|
||||
"build": "bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm",
|
||||
"test": "bun test",
|
||||
"prepublishOnly": "bun run build"
|
||||
"prepublishOnly": "bun run build",
|
||||
"release": "bash ./scripts/release.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"@opencode-ai/plugin": "^1.2.27",
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# Prompt for version bump type
|
||||
read -p "Select version bump (major/minor/patch): " bump
|
||||
if [[ ! "$bump" =~ ^(major|minor|patch)$ ]]; then
|
||||
echo "Invalid choice. Must be 'major', 'minor', or 'patch'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run tests
|
||||
echo "Running test suite..."
|
||||
npm test
|
||||
|
||||
# Build the project
|
||||
echo "Building the project..."
|
||||
npm run build
|
||||
|
||||
# Bump version
|
||||
echo "Bumping version ($bump)..."
|
||||
npm version "$bump" -m "chore(release): %s"
|
||||
|
||||
# Show git status
|
||||
git status
|
||||
|
||||
# Confirm publishing
|
||||
read -p "Proceed with npm publish? (y/N): " confirm
|
||||
if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then
|
||||
echo "Publish aborted."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Publish to npm
|
||||
npm publish
|
||||
|
||||
# Push git commits and tags
|
||||
git push && git push --tags
|
||||
|
||||
echo "Release completed successfully."
|
||||
Reference in New Issue
Block a user