You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ke...@apache.org on 2022/11/30 19:54:20 UTC
[beam] branch master updated: [Github Actions] - Cut Release Branch Workflow (#24020)
This is an automated email from the ASF dual-hosted git repository.
kenn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 012c885af43 [Github Actions] - Cut Release Branch Workflow (#24020)
012c885af43 is described below
commit 012c885af43f6c7d6a6e87fd0adabbfc2ce100d6
Author: Benjamin Gonzalez <74...@users.noreply.github.com>
AuthorDate: Wed Nov 30 13:54:13 2022 -0600
[Github Actions] - Cut Release Branch Workflow (#24020)
---
.github/workflows/cut_release_branch.yml | 111 +++++++++++++++++++++++++++++++
CI.md | 6 ++
2 files changed, 117 insertions(+)
diff --git a/.github/workflows/cut_release_branch.yml b/.github/workflows/cut_release_branch.yml
new file mode 100644
index 00000000000..e89b8da829c
--- /dev/null
+++ b/.github/workflows/cut_release_branch.yml
@@ -0,0 +1,111 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+ workflow_dispatch:
+ inputs:
+ RELEASE_VERSION:
+ description: Beam version of current release
+ required: true
+ NEXT_VERSION:
+ description: Next release version
+ required: true
+
+jobs:
+ update_master:
+ runs-on: [self-hosted, ubuntu-20.04]
+ env:
+ MASTER_BRANCH: master
+ NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+ SCRIPT_DIR: ./release/src/main/scripts
+ steps:
+ - name: Validate Next Version
+ run: |
+ if [[ $NEXT_RELEASE =~ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
+ echo "NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}" >> $GITHUB_ENV
+ else
+ echo "The input for NEXT_RELEASE does not match a valid format [0-9]+\.[0-9]+\.[0-9]+"
+ exit 1
+ fi
+ - name: Check out code
+ uses: actions/checkout@v3
+ - name: Set git config
+ run: |
+ git config user.name $GITHUB_ACTOR
+ git config user.email actions@"$RUNNER_NAME".local
+ - name: Update master branch
+ run: |
+ bash "${SCRIPT_DIR}/set_version.sh" "${NEXT_VERSION_IN_BASE_BRANCH}"
+ echo "==============Update master branch as following================"
+ git diff
+ echo "==============================================================="
+ - name: Commit and Push to master branch files with Next Version
+ run: |
+ git add *
+ git commit -m "Moving to ${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT on master branch."
+ git push origin ${MASTER_BRANCH}
+
+ update_release_branch:
+ needs: update_master
+ runs-on: [self-hosted, ubuntu-20.04]
+ env:
+ RELEASE: ${{ github.event.inputs.RELEASE_VERSION }}
+ steps:
+ - name: Validate Release Version
+ run: |
+ if [[ ${RELEASE} =~ ([0-9]+\.[0-9]+\.[0-9]+) ]]; then
+ echo "RELEASE_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
+ echo "RELEASE_BRANCH=release-${RELEASE}" >> $GITHUB_ENV
+ else
+ echo "The input for RELEASE does not match a valid format [0-9]+\.[0-9]+\.[0-9]+"
+ exit 1
+ fi
+ - name: Check out code
+ uses: actions/checkout@v3
+ - name: Set git config
+ run: |
+ git config user.name $GITHUB_ACTOR
+ git config user.email actions@"$RUNNER_NAME".local
+ - name: Checkout to release branch
+ run: |
+ git checkout -b ${RELEASE_BRANCH}
+ echo "==================Current working branch======================="
+ echo ${RELEASE_BRANCH}
+ echo "==============================================================="
+ - name: Update release version for dataflow runner
+ run: |
+ sed -i -e "s/'beam-master-.*'/'${RELEASE}'/g" \
+ runners/google-cloud-dataflow-java/build.gradle
+ echo "===============Update release branch as following=============="
+ git diff
+ echo "==============================================================="
+ - name: Commit and Push to release branch
+ run: |
+ git add runners/google-cloud-dataflow-java/build.gradle
+ git commit -m "Set Dataflow container to release version."
+ git push --set-upstream origin ${RELEASE_BRANCH}
+
+
+
+
+
diff --git a/CI.md b/CI.md
index cb26171654b..2f000a3c76d 100644
--- a/CI.md
+++ b/CI.md
@@ -127,6 +127,12 @@ Service Account shall have following permissions ([IAM roles](https://cloud.goog
### Release Preparation and Validation Workflows
+#### Cut Release Branch - [verify_release_build.yml](.github/workflows/cut_release_branch.yml)
+| Job | Description | Pull Request Run | Direct Push/Merge Run | Scheduled Run | Requires GCP Credentials |
+|-----------------------|------------------------------------------------------------|------------------|-----------------------|---------------|--------------------------|
+| Update Master | Update Apache Beam master branch with next release version | No | No | No | No |
+| Update Release Branch | Cut release branch for current development version | No | No | No | No |
+
#### Verify Release Build - [verify_release_build.yml](.github/workflows/verify_release_build.yml)
| Job | Description | Pull Request Run | Direct Push/Merge Run | Scheduled Run | Requires GCP Credentials |