diff --git a/.github/workflows/setup-release-candidate.yml b/.github/workflows/setup-release-candidate.yml index 97e5aa5adfb..8a96e757fae 100644 --- a/.github/workflows/setup-release-candidate.yml +++ b/.github/workflows/setup-release-candidate.yml @@ -3,21 +3,6 @@ name: Setup Release Candidate on: workflow_dispatch: inputs: - versionIncrement: - description: 'Release Version Increment' - default: 'Minor' - required: true - type: choice - options: - - Major - - Minor - - Patch - - Custom - customVersion: - description: "Custom Release Version (only used if release increment is 'Custom') - Format: 3.15.0" - default: '' - required: false - type: string commitId: description: 'Commit ID to create RC from' required: true @@ -41,73 +26,20 @@ jobs: node-version: '18' cache: 'npm' - - name: Calculate Release Versions - id: release-version - env: - CUSTOM_VERSION: ${{ inputs.customVersion }} - VERSION_INCREMENT: ${{ inputs.versionIncrement }} + - name: Generate Branch Name + id: branch-name run: | - customVersion="$CUSTOM_VERSION" - versionIncrement="$VERSION_INCREMENT" - - increment_version() { - local currentVersion=$1 - if [[ "$versionIncrement" == "Custom" && -n "$customVersion" ]]; then - echo "$customVersion" - else - IFS='.' read -r major minor patch <<< "$currentVersion" - case "$versionIncrement" in - "Major") - major=$((major + 1)) - minor=0 - patch=0 - ;; - "Minor") - minor=$((minor + 1)) - patch=0 - ;; - "Patch") - patch=$((patch + 1)) - ;; - esac - echo "$major.$minor.$patch" - fi - } - - # Read and increment toolkit version - toolkitCurrentVersion=$(node -e "console.log(require('./packages/toolkit/package.json').version)" | sed 's/-SNAPSHOT//') - toolkitNewVersion=$(increment_version "$toolkitCurrentVersion") - - # Read and increment amazonq version - amazonqCurrentVersion=$(node -e "console.log(require('./packages/amazonq/package.json').version)" | sed 's/-SNAPSHOT//') - amazonqNewVersion=$(increment_version "$amazonqCurrentVersion") - - echo "TOOLKIT_VERSION=$toolkitNewVersion" >> $GITHUB_OUTPUT - echo "AMAZONQ_VERSION=$amazonqNewVersion" >> $GITHUB_OUTPUT - # Use date-based branch naming instead of version-based because we release - # both extensions (toolkit and amazonq) from the same branch, and they may - # have different version numbers. We can change this in the future echo "BRANCH_NAME=release/rc-$(date +%Y%m%d)" >> $GITHUB_OUTPUT - - name: Create RC Branch and Update Versions + - name: Create RC Branch env: - TOOLKIT_VERSION: ${{ steps.release-version.outputs.TOOLKIT_VERSION }} - AMAZONQ_VERSION: ${{ steps.release-version.outputs.AMAZONQ_VERSION }} - BRANCH_NAME: ${{ steps.release-version.outputs.BRANCH_NAME }} + BRANCH_NAME: ${{ steps.branch-name.outputs.BRANCH_NAME }} run: | git config user.name "aws-toolkit-automation" git config user.email "<>" - # Create RC branch using date-based naming + # Create RC branch from specified commit git checkout -b $BRANCH_NAME - # Update package versions individually - npm version --no-git-tag-version $TOOLKIT_VERSION -w packages/toolkit - npm version --no-git-tag-version $AMAZONQ_VERSION -w packages/amazonq - - # Commit version changes - git add packages/toolkit/package.json packages/amazonq/package.json package-lock.json - git commit -m "chore: bump versions - toolkit=$TOOLKIT_VERSION, amazonq=$AMAZONQ_VERSION" - # Push RC branch git push origin $BRANCH_NAME