Skip to content

Commit 1f580bc

Browse files
committed
DRAFT IDEA of "pluggable" tools release workflows
1 parent c0d20c3 commit 1f580bc

27 files changed

Lines changed: 1350 additions & 462 deletions

.github/workflows/apprunner-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ name: Apprunner CI
2828

2929
on:
3030
push:
31-
branches: [ "main" ]
31+
branches: [ "main", "release/*" ]
3232
paths:
3333
- 'apprunner/**'
3434
- '.github/**'
3535
pull_request:
36+
branches: [ "main", "release/*" ]
3637
paths:
3738
- 'apprunner/**'
3839
- '.github/**'

.github/workflows/release-1-create-release-branch.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ name: Release - 1 - Create Release Branch
2222
on:
2323
workflow_dispatch:
2424
inputs:
25+
tool:
26+
description: 'The tool directory to release (e.g., apprunner or iceberg-catalog-migrator)'
27+
required: true
28+
type: string
2529
version:
2630
description: 'Release version without RC number (e.g., 1.0.0-incubating)'
2731
required: true
@@ -48,9 +52,6 @@ jobs:
4852
# Use a token with write permissions
4953
token: ${{ secrets.GITHUB_TOKEN }}
5054

51-
- name: Setup test environment
52-
uses: ./.github/actions/setup-test-env
53-
5455
- name: Set up environment variables
5556
run: |
5657
echo "RELEASEY_DIR=$(pwd)/releasey" >> $GITHUB_ENV
@@ -75,22 +76,30 @@ jobs:
7576
source "${LIBS_DIR}/_version.sh"
7677
7778
# Extract release parameters from workflow inputs
79+
tool="${{ github.event.inputs.tool }}"
7880
version="${{ github.event.inputs.version }}"
7981
8082
echo "## Parameters" >> $GITHUB_STEP_SUMMARY
8183
84+
if [[ ! -d "${tool}/releasey" ]]; then
85+
echo "❌ The directory ${tool}/releasey does not exist." >> $GITHUB_STEP_SUMMARY
86+
exit 1
87+
fi
88+
8289
# Validate version format and extract components
8390
if ! validate_and_extract_polaris_version "${version}"; then
8491
echo "❌ Invalid version format. Expected: major.minor.patch-incubating, got: ${version}" >> $GITHUB_STEP_SUMMARY
8592
exit 1
8693
fi
8794
95+
echo "Tool: \`${tool}\`" >> $GITHUB_STEP_SUMMARY
8896
echo "Version: \`${version}\`" >> $GITHUB_STEP_SUMMARY
8997
9098
# Create branch name in major.minor.x format
91-
branch_name="${major}.${minor}.x"
99+
branch_name="${tool}-${major}.${minor}.x"
92100
93101
# Export parameters for next step
102+
echo "tool=${tool}" >> $GITHUB_ENV
94103
echo "version=${version}" >> $GITHUB_ENV
95104
echo "branch_name=${branch_name}" >> $GITHUB_ENV
96105

.github/workflows/release-2-update-release-candidate.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ jobs:
4444
# Use a token with write permissions
4545
token: ${{ secrets.GITHUB_TOKEN }}
4646

47-
- name: Setup test environment
48-
uses: ./.github/actions/setup-test-env
49-
5047
- name: Configure Git
5148
run: |
5249
git config --global user.name "github-actions[bot]"
@@ -76,13 +73,19 @@ jobs:
7673
echo "## Parameters" >> $GITHUB_STEP_SUMMARY
7774
7875
# Validate that we're on a release branch
79-
if [[ ! "${current_branch}" =~ ^release/(.+)$ ]]; then
76+
if [[ ! "${current_branch}" =~ ^release/([a-z-]+)-(.+)$ ]]; then
8077
echo "❌ Invalid branch: \`${current_branch}\`. This workflow must be run from a release branch (release/major.minor.x)" >> $GITHUB_STEP_SUMMARY
8178
exit 1
8279
fi
8380
84-
# Extract version from release branch name
85-
branch_version="${BASH_REMATCH[1]}"
81+
# Extract tool name and version from release branch name
82+
tool="${BASH_REMATCH[1]}"
83+
branch_version="${BASH_REMATCH[2]}"
84+
85+
if [[ ! -d "${tool}/releasey" ]]; then
86+
echo "❌ The directory ${tool}/releasey does not exist." >> $GITHUB_STEP_SUMMARY
87+
exit 1
88+
fi
8689
8790
# Validate branch version format and extract components
8891
if ! validate_and_extract_branch_version "${branch_version}"; then
@@ -100,10 +103,11 @@ jobs:
100103
find_next_rc_number "${version_without_rc}"
101104
102105
# Build the new release tag
103-
release_tag="apache-polaris-${version_without_rc}-rc${rc_number}"
106+
release_tag="apache-polaris-${tool}-${version_without_rc}-rc${rc_number}"
104107
105108
# Export all variables for next steps
106109
echo "release_tag=${release_tag}" >> $GITHUB_ENV
110+
echo "tool=${tool}" >> $GITHUB_ENV
107111
echo "major=${major}" >> $GITHUB_ENV
108112
echo "minor=${minor}" >> $GITHUB_ENV
109113
echo "patch=${patch}" >> $GITHUB_ENV
@@ -114,6 +118,7 @@ jobs:
114118
cat <<EOT >> $GITHUB_STEP_SUMMARY
115119
| Parameter | Value |
116120
| --- | --- |
121+
| Tool | \`${tool}\` |
117122
| Release branch | \`${current_branch}\` |
118123
| Version without RC | \`${version_without_rc}\` |
119124
| RC number | \`${rc_number}\` |
@@ -149,16 +154,18 @@ jobs:
149154
run: |
150155
source "${LIBS_DIR}/_version.sh"
151156
152-
update_version "${version_without_rc}"
157+
# Call tool-specific version update script
158+
(cd ${tool} ; ./releasey/update_version.sh)
159+
153160
cat <<EOT >> $GITHUB_STEP_SUMMARY
154161
## Version update
155162
All version files updated to \`${version_without_rc}\`
156163
EOT
157164
158165
- name: Update changelog
159166
run: |
160-
source "${LIBS_DIR}/_exec.sh"
161-
exec_process ./gradlew patchChangelog
167+
# Call tool-specific update changelog script
168+
(cd ${tool} ; ./releasey/update_changelog.sh)
162169
163170
cat <<EOT >> $GITHUB_STEP_SUMMARY
164171
## Changelog
@@ -171,11 +178,6 @@ jobs:
171178
source "${LIBS_DIR}/_exec.sh"
172179
173180
# Commit version files and changelog
174-
exec_process git add \
175-
"$VERSION_FILE" \
176-
"$HELM_CHART_YAML_FILE" \
177-
"$HELM_README_FILE" \
178-
"$CHANGELOG_FILE"
179181
exec_process git commit -m "[chore] Bump version to ${version_without_rc} for release candidate ${rc_number}"
180182
181183
# Push the changes

0 commit comments

Comments
 (0)