@@ -3,21 +3,6 @@ name: Setup Release Candidate
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
- versionIncrement :
7
- description : ' Release Version Increment'
8
- default : ' Minor'
9
- required : true
10
- type : choice
11
- options :
12
- - Major
13
- - Minor
14
- - Patch
15
- - Custom
16
- customVersion :
17
- description : " Custom Release Version (only used if release increment is 'Custom') - Format: 3.15.0"
18
- default : ' '
19
- required : false
20
- type : string
21
6
commitId :
22
7
description : ' Commit ID to create RC from'
23
8
required : true
@@ -41,73 +26,20 @@ jobs:
41
26
node-version : ' 18'
42
27
cache : ' npm'
43
28
44
- - name : Calculate Release Versions
45
- id : release-version
46
- env :
47
- CUSTOM_VERSION : ${{ inputs.customVersion }}
48
- VERSION_INCREMENT : ${{ inputs.versionIncrement }}
29
+ - name : Generate Branch Name
30
+ id : branch-name
49
31
run : |
50
- customVersion="$CUSTOM_VERSION"
51
- versionIncrement="$VERSION_INCREMENT"
52
-
53
- increment_version() {
54
- local currentVersion=$1
55
- if [[ "$versionIncrement" == "Custom" && -n "$customVersion" ]]; then
56
- echo "$customVersion"
57
- else
58
- IFS='.' read -r major minor patch <<< "$currentVersion"
59
- case "$versionIncrement" in
60
- "Major")
61
- major=$((major + 1))
62
- minor=0
63
- patch=0
64
- ;;
65
- "Minor")
66
- minor=$((minor + 1))
67
- patch=0
68
- ;;
69
- "Patch")
70
- patch=$((patch + 1))
71
- ;;
72
- esac
73
- echo "$major.$minor.$patch"
74
- fi
75
- }
76
-
77
- # Read and increment toolkit version
78
- toolkitCurrentVersion=$(node -e "console.log(require('./packages/toolkit/package.json').version)" | sed 's/-SNAPSHOT//')
79
- toolkitNewVersion=$(increment_version "$toolkitCurrentVersion")
80
-
81
- # Read and increment amazonq version
82
- amazonqCurrentVersion=$(node -e "console.log(require('./packages/amazonq/package.json').version)" | sed 's/-SNAPSHOT//')
83
- amazonqNewVersion=$(increment_version "$amazonqCurrentVersion")
84
-
85
- echo "TOOLKIT_VERSION=$toolkitNewVersion" >> $GITHUB_OUTPUT
86
- echo "AMAZONQ_VERSION=$amazonqNewVersion" >> $GITHUB_OUTPUT
87
- # Use date-based branch naming instead of version-based because we release
88
- # both extensions (toolkit and amazonq) from the same branch, and they may
89
- # have different version numbers. We can change this in the future
90
32
echo "BRANCH_NAME=release/rc-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
91
33
92
- - name : Create RC Branch and Update Versions
34
+ - name : Create RC Branch
93
35
env :
94
- TOOLKIT_VERSION : ${{ steps.release-version.outputs.TOOLKIT_VERSION }}
95
- AMAZONQ_VERSION : ${{ steps.release-version.outputs.AMAZONQ_VERSION }}
96
- BRANCH_NAME : ${{ steps.release-version.outputs.BRANCH_NAME }}
36
+ BRANCH_NAME : ${{ steps.branch-name.outputs.BRANCH_NAME }}
97
37
run : |
98
38
git config user.name "aws-toolkit-automation"
99
39
git config user.email "<>"
100
40
101
- # Create RC branch using date-based naming
41
+ # Create RC branch from specified commit
102
42
git checkout -b $BRANCH_NAME
103
43
104
- # Update package versions individually
105
- npm version --no-git-tag-version $TOOLKIT_VERSION -w packages/toolkit
106
- npm version --no-git-tag-version $AMAZONQ_VERSION -w packages/amazonq
107
-
108
- # Commit version changes
109
- git add packages/toolkit/package.json packages/amazonq/package.json package-lock.json
110
- git commit -m "chore: bump versions - toolkit=$TOOLKIT_VERSION, amazonq=$AMAZONQ_VERSION"
111
-
112
44
# Push RC branch
113
45
git push origin $BRANCH_NAME
0 commit comments