| # 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. |
| |
| # To learn more about GitHub Actions in Apache Beam check the CI.md |
| |
| name: Verify Release Build |
| on: |
| workflow_dispatch: |
| inputs: |
| RELEASE_VER: |
| description: Beam version of current release |
| required: true |
| COMMENT_TRIGGER_PHRASES: |
| description: Flag to comment the Jenkins Trigger Phrases in the new PR |
| required: true |
| env: |
| WORKING_BRANCH: postcommit_validation_pr |
| jobs: |
| verify_release: |
| runs-on: [self-hosted, ubuntu-20.04] |
| permissions: |
| pull-requests: write |
| contents: write |
| env: |
| RELEASE_VER: ${{ github.event.inputs.RELEASE_VER }} |
| steps: |
| - name: Verify branch name |
| run: ./scripts/ci/ci_check_git_branch.sh $WORKING_BRANCH |
| |
| - name: Set RELEASE_BRANCH env variable |
| run: | |
| RELEASE_BRANCH=release-${{env.RELEASE_VER}} |
| echo "RELEASE_BRANCH=${RELEASE_BRANCH}" >> $GITHUB_ENV |
| - name: Check out code |
| uses: actions/checkout@v3 |
| with: |
| ref: ${{ env.RELEASE_BRANCH }} |
| - name: Install gh cli |
| uses: ./.github/actions/setup-gh-cli-linux |
| - name: Set git config |
| run: | |
| git config user.name $GITHUB_ACTOR |
| git config user.email actions@"$RUNNER_NAME".local |
| - name: Set Release Version |
| run: | |
| git checkout -b ${{env.WORKING_BRANCH}} --quiet |
| /bin/bash release/src/main/scripts/set_version.sh "$RELEASE_VER" --git-add |
| # In case the version string was not changed, append a newline to CHANGES.md |
| echo "" >> CHANGES.md |
| - name: Push Changes in ${{ env.WORKING_BRANCH }} Branch |
| run: | |
| git add CHANGES.md |
| git commit -m "Changed version.py and gradle.properties to python dev version to create a test PR" --quiet |
| git push origin $WORKING_BRANCH --quiet |
| - name: Create new Release PR |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| run: | |
| GITHUB_PR_URL=$(gh pr create -B ${{env.RELEASE_BRANCH}} -H ${{env.WORKING_BRANCH}} -t "[DO NOT MERGE] Run all PostCommit and PreCommit Tests against Release Branch" -b "Run Gradle Release Build and Jenkins PreCommit and PostCommits tests automatically in this PR (refer to scripts/ci/release/mass_comment.txt). Please run the missing tests manually.") |
| # Run Gradle Release Build and PostCommit/PreCommit Tests against Release Branch on Jenkins. |
| - name: Comment Jenkins Trigger Phrases in PR |
| if: ${{ github.event.inputs.COMMENT_TRIGGER_PHRASES == 'true' }} |
| run: | |
| sh ./comment_pr_trigger_phrases.sh $GITHUB_PR_URL |
| env: |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| working-directory: 'scripts/ci/release' |