-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·45 lines (34 loc) · 1.39 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·45 lines (34 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e
# Checkout and update develop branch
git checkout develop && git pull origin develop
# Push to edge
echo "Pushing develop to edge"
git push -f origin HEAD:edge
# Get current version from package.json
current_version=$(node -p "require('./package.json').version")
# Get next version based on commits
next_version=$(get-next-version --fix-prefixes "fix,chore,build,refactor,ref,perf")
# Determine the semver bump type (major, minor, or patch)
bump_type=$(node -e "
const semver = require('semver');
const diff = semver.diff('$current_version', '$next_version');
console.log(diff || 'patch');
")
echo "Current version: $current_version"
echo "Next version: $next_version"
echo "Bump type: $bump_type"
# Create release branch
git checkout -b "release-$next_version"
# Bump version in package.json
npm version "$bump_type"
# Push release branch and tags
git push origin "release-$next_version"
git push --tags
# Create pull requests to develop, release, and master
echo "Creating pull requests..."
gh pr create --base develop --title "Release: merge to develop" --body "Release version $next_version"
gh pr create --base release --title "Release: merge to release" --body "Release version $next_version"
gh pr create --base master --title "Release: merge to master" --body "Release version $next_version"
echo "Release process complete!"
echo "PRs created for develop, release, and master branches"