snazy commented on code in PR #2383: URL: https://github.com/apache/polaris/pull/2383#discussion_r2285122814
########## .github/workflows/release-2-update-release-candidate.yml: ########## @@ -0,0 +1,261 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Release - 2 - Update version and Changelog for Release Candidate + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run mode (check to enable, uncheck to perform actual operations)' + required: false + type: boolean + default: true + +jobs: + update-release-candidate: + name: Release - 2 - Update version and Changelog for Release Candidate + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + # Fetch full history for proper branch operations + fetch-depth: 0 + # Use a token with write permissions + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Set DRY_RUN environment variable + run: | + if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then + echo "DRY_RUN=1" >> $GITHUB_ENV + echo "DRY_RUN mode enabled - no actual changes will be made" + else + echo "DRY_RUN=0" >> $GITHUB_ENV + echo "DRY_RUN mode disabled - actual changes will be made" + fi + + - name: Auto-determine release branch and next RC number + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_version.sh" + + # Get the current branch name + current_branch=$(git branch --show-current) + print_info "Current branch: ${current_branch}" + + # Validate that we're on a release branch + if [[ ! "${current_branch}" =~ ^release/(.+)$ ]]; then + print_error "This workflow must be run from a release branch (release/x.y.z-incubating)" + print_error "Current branch: ${current_branch}" + exit 1 + fi + + # Extract version from release branch name + branch_version="${BASH_REMATCH[1]}" + print_info "Extracted version from branch: ${branch_version}" + + # Validate branch version format and extract components + if ! validate_and_extract_branch_version "${branch_version}"; then + print_error "Invalid release branch version format: ${branch_version}" + print_error "Expected format: x.y.z-incubating" + exit 1 + fi + + print_info "Parsed version components from branch:" + print_info " Major: ${major}" + print_info " Minor: ${minor}" + print_info " Patch: ${patch}" + print_info " Version without RC: ${version_without_rc}" Review Comment: Also useful in the WF summary. Mind adding the version also as a concatenated string with and without the RC suffix? For the lazy copy-paste-people out there. ########## .github/workflows/release-2-update-release-candidate.yml: ########## @@ -0,0 +1,261 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Release - 2 - Update version and Changelog for Release Candidate + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run mode (check to enable, uncheck to perform actual operations)' + required: false + type: boolean + default: true + +jobs: + update-release-candidate: + name: Release - 2 - Update version and Changelog for Release Candidate + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + # Fetch full history for proper branch operations + fetch-depth: 0 + # Use a token with write permissions + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Set DRY_RUN environment variable + run: | + if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then + echo "DRY_RUN=1" >> $GITHUB_ENV + echo "DRY_RUN mode enabled - no actual changes will be made" + else + echo "DRY_RUN=0" >> $GITHUB_ENV + echo "DRY_RUN mode disabled - actual changes will be made" + fi + + - name: Auto-determine release branch and next RC number + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_version.sh" + + # Get the current branch name + current_branch=$(git branch --show-current) + print_info "Current branch: ${current_branch}" + + # Validate that we're on a release branch + if [[ ! "${current_branch}" =~ ^release/(.+)$ ]]; then + print_error "This workflow must be run from a release branch (release/x.y.z-incubating)" + print_error "Current branch: ${current_branch}" + exit 1 + fi + + # Extract version from release branch name + branch_version="${BASH_REMATCH[1]}" + print_info "Extracted version from branch: ${branch_version}" + + # Validate branch version format and extract components + if ! validate_and_extract_branch_version "${branch_version}"; then + print_error "Invalid release branch version format: ${branch_version}" + print_error "Expected format: x.y.z-incubating" + exit 1 + fi + + print_info "Parsed version components from branch:" + print_info " Major: ${major}" + print_info " Minor: ${minor}" + print_info " Patch: ${patch}" + print_info " Version without RC: ${version_without_rc}" + + # Find the next available RC number by checking existing tags + find_next_rc_number "${version_without_rc}" + print_info "Next RC number: ${rc_number}" + + # Build the new release tag + release_tag="apache-polaris-${version_without_rc}-rc${rc_number}" + + # Export all variables for next steps + echo "release_tag=${release_tag}" >> $GITHUB_ENV + echo "major=${major}" >> $GITHUB_ENV + echo "minor=${minor}" >> $GITHUB_ENV + echo "patch=${patch}" >> $GITHUB_ENV + echo "rc_number=${rc_number}" >> $GITHUB_ENV + echo "version_without_rc=${version_without_rc}" >> $GITHUB_ENV + echo "release_branch=${current_branch}" >> $GITHUB_ENV + + print_success "Determined release candidate details:" + print_info " Release branch: ${current_branch}" + print_info " Release tag: ${release_tag}" + print_info " Version without RC: ${version_without_rc}" + print_info " RC number: ${rc_number}" + + - name: Verify GitHub checks are passing + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_exec.sh" + source "${LIBS_DIR}/_github.sh" + + # Get the current HEAD commit SHA + current_commit=$(git rev-parse HEAD) + + print_info "Verifying GitHub checks for commit: ${current_commit}" + + # Verify all GitHub checks are passing + if ! check_github_checks_passed "${current_commit}"; then + print_error "GitHub checks are not all passing for commit ${current_commit}" + print_error "Please ensure all checks pass before updating the release candidate" + exit 1 + fi + + print_success "All GitHub checks are passing for commit ${current_commit}" + + - name: Set up Java + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 + with: + distribution: 'temurin' + java-version: '21' + + - name: Update project versions + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_exec.sh" + source "${LIBS_DIR}/_version.sh" + + print_info "Updating project version to ${version_without_rc}" + update_version "${version_without_rc}" + + print_success "Project version updated to ${version_without_rc}" + + - name: Update changelog + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_exec.sh" + + print_info "Updating CHANGELOG.md" + exec_process ./gradlew patchChangelog + + print_success "Changelog updated successfully" + + - name: Commit and push changes + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_exec.sh" + + print_info "Committing version and changelog changes" + + # Commit version files and changelog + exec_process git add "$VERSION_FILE" "$HELM_CHART_YAML_FILE" "$HELM_README_FILE" "$HELM_VALUES_FILE" + exec_process git add "$CHANGELOG_FILE" + exec_process git commit -m "[chore] Bump version to ${version_without_rc} for release candidate ${rc_number}" + + # Push the changes + exec_process git push origin "${release_branch}" + + # Get the new commit SHA after our changes + new_tag_ref=$(git rev-parse HEAD) + echo "new_tag_ref=${new_tag_ref}" >> $GITHUB_ENV + + print_info "Changes committed and pushed. New commit: ${new_tag_ref}" + + - name: Create RC tag at new commit + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_exec.sh" + + print_info "Creating RC tag ${release_tag} at commit ${new_tag_ref}" + + # Create the tag at the new commit + exec_process git tag "${release_tag}" "${new_tag_ref}" + exec_process git push origin "${release_tag}" + + print_success "🎉 RC tag ${release_tag} created successfully at commit ${new_tag_ref}!" Review Comment: This is an example of information that would be useful to have in the GH workflow summary. ########## .github/workflows/release-1-create-release-branch.yml: ########## @@ -0,0 +1,119 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Release - 1 - Create Release Branch + +on: + workflow_dispatch: + inputs: + version: + description: 'Release version without RC number (e.g., 1.0.0-incubating)' + required: true + type: string + dry_run: + description: 'Dry run mode (check to enable, uncheck to perform actual operations)' + required: false + type: boolean + default: true + +jobs: + create-release-branch: + name: Release - 1 - Create Release Branch + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + # Fetch full history for proper branch operations + fetch-depth: 0 + # Use a token with write permissions + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Set DRY_RUN environment variable + run: | + if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then + echo "DRY_RUN=1" >> $GITHUB_ENV + echo "DRY_RUN mode enabled - no actual changes will be made" + else + echo "DRY_RUN=0" >> $GITHUB_ENV + echo "DRY_RUN mode disabled - actual changes will be made" + fi + + - name: Validate release parameters + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" Review Comment: Those can be moved into one step that exports the two variables. ########## .github/workflows/release-2-update-release-candidate.yml: ########## @@ -0,0 +1,261 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Release - 2 - Update version and Changelog for Release Candidate + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run mode (check to enable, uncheck to perform actual operations)' + required: false + type: boolean + default: true + +jobs: + update-release-candidate: + name: Release - 2 - Update version and Changelog for Release Candidate + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + # Fetch full history for proper branch operations Review Comment: Nit: ```suggestion # Fetch full history. Branch operations require this. ``` ########## .github/workflows/release-2-update-release-candidate.yml: ########## @@ -0,0 +1,261 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Release - 2 - Update version and Changelog for Release Candidate + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run mode (check to enable, uncheck to perform actual operations)' + required: false + type: boolean + default: true + +jobs: + update-release-candidate: + name: Release - 2 - Update version and Changelog for Release Candidate + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + # Fetch full history for proper branch operations + fetch-depth: 0 + # Use a token with write permissions + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Set DRY_RUN environment variable + run: | + if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then + echo "DRY_RUN=1" >> $GITHUB_ENV + echo "DRY_RUN mode enabled - no actual changes will be made" Review Comment: This information is also useful to see in the summary - maybe as a "big red warning" that it's a dry run. ########## .github/workflows/release-3-build-and-publish-artifacts.yml: ########## @@ -0,0 +1,195 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Release - 3 - Build and Publish Release Artifacts + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run mode (check to enable, uncheck to perform actual operations)' + required: false + type: boolean + default: true + +jobs: + build-and-publish-artifacts: + name: Release - 3 - Build and Publish Release Artifacts + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + dry_run: ${{ steps.set-outputs.outputs.dry_run }} + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + + - name: Set DRY_RUN environment variable + id: set-outputs + run: | + if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then + echo "DRY_RUN=1" >> $GITHUB_ENV + echo "dry_run=1" >> $GITHUB_OUTPUT + echo "DRY_RUN mode enabled - no actual changes will be made" + else + echo "DRY_RUN=0" >> $GITHUB_ENV + echo "dry_run=0" >> $GITHUB_OUTPUT + echo "DRY_RUN mode disabled - actual changes will be made" + fi + + - name: Validate release candidate tag + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_version.sh" + + print_info "Determining version from current git tag..." + + if ! git_tag=$(git describe --tags --exact-match HEAD 2>/dev/null); then + print_error "Current HEAD is not on a release candidate tag. Please checkout a release candidate tag first." + exit 1 + fi + print_info "Found git tag: ${git_tag}" + + # Validate git tag format and extract version components + if ! validate_and_extract_git_tag_version "${git_tag}"; then + print_error "Invalid git tag format: ${git_tag}" + print_error "Expected format: apache-polaris-x.y.z-incubating-rcN" + exit 1 + fi + + print_info "Validated release candidate tag: ${git_tag}" + print_info "Version: ${version_without_rc}" + print_info "RC number: ${rc_number}" + + # Export variables for next steps + echo "git_tag=${git_tag}" >> $GITHUB_ENV + echo "version_without_rc=${version_without_rc}" >> $GITHUB_ENV + echo "rc_number=${rc_number}" >> $GITHUB_ENV + + - name: Set up Java + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 + with: + distribution: 'temurin' + java-version: '21' + + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + git_user_signingkey: true + git_commit_gpgsign: true + + - name: Test and configure GPG key + env: + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + echo "use-agent" >> ~/.gnupg/gpg.conf + gpg-connect-agent reloadagent /bye + + # Test that GPG can sign (this will cache the passphrase) + echo "test" | gpg --batch --yes --passphrase "$GPG_PASSPHRASE" --pinentry-mode loopback --armor --detach-sign + + mkdir -p ~/.gradle + echo "signing.gnupg.keyName=$(gpg --list-secret-keys --keyid-format LONG | grep sec | head -1 | sed 's/.*\/\([A-F0-9]*\).*/\1/')" >> ~/.gradle/gradle.properties + + - name: Build source and binary distributions + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_exec.sh" + + print_info "Building source and binary distributions..." + exec_process ./gradlew build sourceTarball -Prelease -PuseGpgAgent -x test -x intTest Review Comment: ```suggestion exec_process ./gradlew assemble sourceTarball -Prelease -PuseGpgAgent ``` `test` and `intTest` are not the only check tasks. `build` depends on the `assemble` and `check` tasks. But we don't need to run any checks here, as the Git commit status is checked. ########## .github/workflows/release-2-update-release-candidate.yml: ########## @@ -0,0 +1,261 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Release - 2 - Update version and Changelog for Release Candidate + +on: + workflow_dispatch: + inputs: + dry_run: + description: 'Dry run mode (check to enable, uncheck to perform actual operations)' + required: false + type: boolean + default: true + +jobs: + update-release-candidate: + name: Release - 2 - Update version and Changelog for Release Candidate + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + # Fetch full history for proper branch operations + fetch-depth: 0 + # Use a token with write permissions + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Configure Git + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + + - name: Set DRY_RUN environment variable + run: | + if [[ "${{ github.event.inputs.dry_run }}" == "true" ]]; then + echo "DRY_RUN=1" >> $GITHUB_ENV + echo "DRY_RUN mode enabled - no actual changes will be made" + else + echo "DRY_RUN=0" >> $GITHUB_ENV + echo "DRY_RUN mode disabled - actual changes will be made" + fi + + - name: Auto-determine release branch and next RC number + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_version.sh" + + # Get the current branch name + current_branch=$(git branch --show-current) + print_info "Current branch: ${current_branch}" + + # Validate that we're on a release branch + if [[ ! "${current_branch}" =~ ^release/(.+)$ ]]; then + print_error "This workflow must be run from a release branch (release/x.y.z-incubating)" + print_error "Current branch: ${current_branch}" + exit 1 + fi + + # Extract version from release branch name + branch_version="${BASH_REMATCH[1]}" + print_info "Extracted version from branch: ${branch_version}" + + # Validate branch version format and extract components + if ! validate_and_extract_branch_version "${branch_version}"; then + print_error "Invalid release branch version format: ${branch_version}" + print_error "Expected format: x.y.z-incubating" + exit 1 + fi + + print_info "Parsed version components from branch:" + print_info " Major: ${major}" + print_info " Minor: ${minor}" + print_info " Patch: ${patch}" + print_info " Version without RC: ${version_without_rc}" + + # Find the next available RC number by checking existing tags + find_next_rc_number "${version_without_rc}" + print_info "Next RC number: ${rc_number}" + + # Build the new release tag + release_tag="apache-polaris-${version_without_rc}-rc${rc_number}" + + # Export all variables for next steps + echo "release_tag=${release_tag}" >> $GITHUB_ENV + echo "major=${major}" >> $GITHUB_ENV + echo "minor=${minor}" >> $GITHUB_ENV + echo "patch=${patch}" >> $GITHUB_ENV + echo "rc_number=${rc_number}" >> $GITHUB_ENV + echo "version_without_rc=${version_without_rc}" >> $GITHUB_ENV + echo "release_branch=${current_branch}" >> $GITHUB_ENV + + print_success "Determined release candidate details:" + print_info " Release branch: ${current_branch}" + print_info " Release tag: ${release_tag}" + print_info " Version without RC: ${version_without_rc}" + print_info " RC number: ${rc_number}" + + - name: Verify GitHub checks are passing + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_exec.sh" + source "${LIBS_DIR}/_github.sh" + + # Get the current HEAD commit SHA + current_commit=$(git rev-parse HEAD) + + print_info "Verifying GitHub checks for commit: ${current_commit}" + + # Verify all GitHub checks are passing + if ! check_github_checks_passed "${current_commit}"; then + print_error "GitHub checks are not all passing for commit ${current_commit}" + print_error "Please ensure all checks pass before updating the release candidate" + exit 1 + fi + + print_success "All GitHub checks are passing for commit ${current_commit}" + + - name: Set up Java + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4 + with: + distribution: 'temurin' + java-version: '21' + + - name: Update project versions + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_exec.sh" + source "${LIBS_DIR}/_version.sh" + + print_info "Updating project version to ${version_without_rc}" + update_version "${version_without_rc}" + + print_success "Project version updated to ${version_without_rc}" + + - name: Update changelog + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_exec.sh" + + print_info "Updating CHANGELOG.md" + exec_process ./gradlew patchChangelog + + print_success "Changelog updated successfully" + + - name: Commit and push changes + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_constants.sh" + source "${LIBS_DIR}/_exec.sh" + + print_info "Committing version and changelog changes" + + # Commit version files and changelog + exec_process git add "$VERSION_FILE" "$HELM_CHART_YAML_FILE" "$HELM_README_FILE" "$HELM_VALUES_FILE" + exec_process git add "$CHANGELOG_FILE" + exec_process git commit -m "[chore] Bump version to ${version_without_rc} for release candidate ${rc_number}" + + # Push the changes + exec_process git push origin "${release_branch}" + + # Get the new commit SHA after our changes + new_tag_ref=$(git rev-parse HEAD) + echo "new_tag_ref=${new_tag_ref}" >> $GITHUB_ENV + + print_info "Changes committed and pushed. New commit: ${new_tag_ref}" + + - name: Create RC tag at new commit + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_exec.sh" + + print_info "Creating RC tag ${release_tag} at commit ${new_tag_ref}" + + # Create the tag at the new commit + exec_process git tag "${release_tag}" "${new_tag_ref}" + exec_process git push origin "${release_tag}" + + print_success "🎉 RC tag ${release_tag} created successfully at commit ${new_tag_ref}!" + + - name: Create or update GitHub release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + releasey_dir="$(pwd)/releasey" + LIBS_DIR="${releasey_dir}/libs" + + source "${LIBS_DIR}/_log.sh" + source "${LIBS_DIR}/_exec.sh" + + release_title="Release ${version_without_rc}" + + if [[ ${rc_number} -eq 1 ]]; then + print_info "Creating new GitHub release: ${release_title}" + exec_process gh release create "${release_tag}" \ + --title "${release_title}" \ + --prerelease \ + --target "${new_tag_ref}" + + print_success "🎉 GitHub release created: ${release_title}" + else Review Comment: I think what's missing here is the cleanup of the previous RC, like purging data in SVN and deleting the previous's RC Nexus staging repo. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org