Skip to content

Commit 86c94a8

Browse files
Hugo PerezHugo Perez
authored andcommitted
ci: add release workflow and manual release script
Add GitHub Actions workflow for automated releases using semantic-release Include manual release script for version bumping and tagging
1 parent 066c933 commit 86c94a8

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

scripts/manual-release.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "🚀 Manual Release Script"
5+
echo "========================"
6+
7+
# Check if we're on main branch
8+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
9+
if [ "$BRANCH" != "main" ]; then
10+
echo "❌ Must be on main branch to release"
11+
exit 1
12+
fi
13+
14+
# Build, test, and prepare
15+
echo "📦 Building..."
16+
npm run build
17+
18+
echo "✅ Running tests..."
19+
npm test
20+
21+
# Get current version
22+
CURRENT_VERSION=$(node -p "require('./package.json').version")
23+
echo "📌 Current version: $CURRENT_VERSION"
24+
25+
# Read new version from user
26+
echo ""
27+
echo "Enter new version (current: $CURRENT_VERSION):"
28+
read NEW_VERSION
29+
30+
# Update package.json
31+
node -e "
32+
const pkg = require('./package.json');
33+
pkg.version = '$NEW_VERSION';
34+
require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
35+
"
36+
37+
echo "✅ Updated package.json to version $NEW_VERSION"
38+
39+
# Commit
40+
git add package.json
41+
git commit -m "chore(release): $NEW_VERSION"
42+
43+
# Create git tag
44+
git tag -a "v$NEW_VERSION" -m "Release $NEW_VERSION"
45+
46+
echo "📤 Pushing to GitHub..."
47+
git push origin main
48+
git push origin "v$NEW_VERSION"
49+
50+
echo ""
51+
echo "✅ Manual release complete!"
52+
echo "📋 Version: $NEW_VERSION"
53+
echo "🔗 Visit: https://github.com/SOVEREIGN-NET/Sovereign-Network-API-Client/releases"

0 commit comments

Comments
 (0)