This is an automated email from the ASF dual-hosted git repository.

damccorm 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 3440ae59a81 Move snapshot build into cut release branch step (#26438)
3440ae59a81 is described below

commit 3440ae59a815e2ee90528b503d116a21ac5b1672
Author: Danny McCormick <[email protected]>
AuthorDate: Wed Apr 26 14:52:10 2023 -0400

    Move snapshot build into cut release branch step (#26438)
    
    * Move snapshot build into cut release branch step
    
    * Remove snapshot script
---
 .github/workflows/cut_release_branch.yml           | 48 +++++++++++-
 .github/workflows/start_snapshot_build.yml         | 75 ------------------
 release/src/main/scripts/start_snapshot_build.sh   | 89 ----------------------
 .../site/content/en/contribute/release-guide.md    | 33 ++------
 4 files changed, 52 insertions(+), 193 deletions(-)

diff --git a/.github/workflows/cut_release_branch.yml 
b/.github/workflows/cut_release_branch.yml
index 87a37167e87..77a510b945f 100644
--- a/.github/workflows/cut_release_branch.yml
+++ b/.github/workflows/cut_release_branch.yml
@@ -21,8 +21,10 @@
 # To learn more about GitHub Actions in Apache Beam check the CI.md
 
 # Workflow used after 
https://github.com/apache/beam/commit/4183e747becebd18becee5fff547af365910fc9c
-# If help is needed debugging issues, you can view the cut_release_branch.sh 
script at that commit for guidance on how to do this manually.
-# 
(https://github.com/apache/beam/blob/4183e747becebd18becee5fff547af365910fc9c/release/src/main/scripts/cut_release_branch.sh)
+# If help is needed debugging issues, you can view the cut_release_branch.sh 
and start_snapshot_build.sh scripts at that commit
+# for guidance on how to do this manually.
+# 
(https://github.com/apache/beam/blob/4183e747becebd18becee5fff547af365910fc9c/release/src/main/scripts/cut_release_branch.sh
 and 
+# 
https://github.com/apache/beam/blob/4183e747becebd18becee5fff547af365910fc9c/release/src/main/scripts/start_snapshot_build.sh).
 name: Cut Release Branch
 on:
   workflow_dispatch:
@@ -109,3 +111,45 @@ jobs:
           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}
+
+  start_snapshot_build:
+    needs: update_master
+    runs-on: ubuntu-latest
+    env:
+      REMOTE_NAME: remote_repo
+      REMOTE_URL: ${{ github.server_url }}/${{ github.repository }}
+      BRANCH_NAME: snapshot_build-${{ github.event.inputs.RELEASE_VERSION }}
+    steps:
+      - name: Install Hub
+        run: |
+          cd ~
+          wget 
https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz
+          tar zvxvf hub-linux-amd64-2.14.2.tgz
+          sudo ./hub-linux-amd64-2.14.2/install
+          echo "eval "$(hub alias -s)"" >> ~/.bashrc
+      - uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Create Snapshot Branch
+        run: |
+          git remote add ${REMOTE_NAME} ${REMOTE_URL}
+          git checkout -b ${BRANCH_NAME}
+          touch empty_file.txt
+          git add -A
+          git commit -m "Add empty file in order to create PR"
+          git push -f ${REMOTE_NAME}
+      - name: Create Pull Request
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          hub pull-request -F- <<<"[DO NOT MERGE]Start snapshot build for 
release process 
+          
+          
+          Run Gradle Publish"
+          
+          echo "NOTE: If there is no jenkins job started, please comment 
generated PR with: Run Gradle Publish"
+          echo "Things remained you need to do manually after build 
successful:"
+          echo "1. Close this generated PR in github website."
+          echo "2. Delete your remote branch ${BRANCH_NAME} form your beam 
repo in github website."
diff --git a/.github/workflows/start_snapshot_build.yml 
b/.github/workflows/start_snapshot_build.yml
deleted file mode 100644
index 75558aa2866..00000000000
--- a/.github/workflows/start_snapshot_build.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-# 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
-
-# This workflow will create an empty PR and start gradle publish job.
-
-name: Start Snapshot Build
-
-on:
-  workflow_dispatch:
-    inputs:
-      USER_REMOTE_URL:
-        description: Your beam repo URL
-        required: true
-        default: https://github.com/apache/beam.git
-
-jobs:
-  start_snapshot_build:
-    runs-on: [self-hosted, ubuntu-20.04]
-    env:
-      REMOTE_NAME: remote_repo
-      REMOTE_URL: ${{ github.event.inputs.USER_REMOTE_URL }}
-      BRANCH_NAME: snapshot_build
-    steps:
-      - name: Install Hub
-        run: |
-          cd ~
-          wget 
https://github.com/github/hub/releases/download/v2.14.2/hub-linux-amd64-2.14.2.tgz
-          tar zvxvf hub-linux-amd64-2.14.2.tgz
-          sudo ./hub-linux-amd64-2.14.2/install
-          echo "eval "$(hub alias -s)"" >> ~/.bashrc
-      - uses: actions/checkout@v3
-      - name: Set git config
-        run: |
-          git config user.name $GITHUB_ACTOR
-          git config user.email actions@"$RUNNER_NAME".local
-      - name: Create Snapshot Branch
-        run: |
-          git remote add ${REMOTE_NAME} ${REMOTE_URL}
-          git checkout -b ${BRANCH_NAME}
-          touch empty_file.txt
-          git add -A
-          git commit -m "Add empty file in order to create PR"
-          git push -f ${REMOTE_NAME}
-      - name: Create Pull Request
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        run: |
-          hub pull-request -F- <<<"[DO NOT MERGE]Start snapshot build for 
release process 
-          
-          
-          Run Gradle Publish"
-          
-          echo "NOTE: If there is no jenkins job started, please comment 
generated PR with: Run Gradle Publish"
-          echo "Things remained you need to do manually after build 
successful:"
-          echo "1. Close this generated PR in github website."
-          echo "2. Delete your remote branch ${BRANCH_NAME} form your beam 
repo in github website."
\ No newline at end of file
diff --git a/release/src/main/scripts/start_snapshot_build.sh 
b/release/src/main/scripts/start_snapshot_build.sh
deleted file mode 100755
index 8c6d6ea8a3b..00000000000
--- a/release/src/main/scripts/start_snapshot_build.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/bash
-#
-#    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 script will create a empty PR and start gradle publish job.
-
-set -e
-
-LOCAL_BEAM_DIR=beam_snapshot_build
-HUB_VERSION=2.5.0
-HUB_ARTIFACTS_NAME=hub-linux-amd64-${HUB_VERSION}
-GIT_REPO_URL=https://github.com/apache/beam.git
-USER_REMOTE_URL=
-USER_REMOTE_NAME=remote_repo
-BEAM_ROOT_DIR=beam
-BRANCH_NAME=snapshot_build
-
-echo "Please enter your repo URL forked from apache beam:"
-read USER_REMOTE_URL
-
-echo "=================Environment Variables==============="
-echo "Your beam repo URL: ${USER_REMOTE_URL}"
-echo "Beam repo will be cloned into: ~/${LOCAL_BEAM_DIR}/"
-echo "New PR will be created on branch: ${BRANCH_NAME}"
-
-cd ~
-
-echo "=================Checking hub========================"
-if [[ -z `which hub` ]]; then
-  echo "There is no hub installed on your machine."
-  echo "Would you like to install hub with root permission? [y|N]"
-  read confirmation
-  if [[ $confirmation != "y"  ]]; then
-    echo "Refused to install hub. Cannot proceed into next setp."
-    exit
-  fi
-  echo "=================Installing hub======================="
-  wget 
https://github.com/github/hub/releases/download/v${HUB_VERSION}/${HUB_ARTIFACTS_NAME}.tgz
-  tar zvxvf ${HUB_ARTIFACTS_NAME}.tgz
-  sudo ./${HUB_ARTIFACTS_NAME}/install
-  echo "eval "$(hub alias -s)"" >> ~/.bashrc
-  rm -rf ${HUB_ARTIFACTS_NAME}*
-fi
-hub version
-
-echo "===============Starting creating empty PR==============="
-cd ~
-if [[ -d ${LOCAL_BEAM_DIR} ]]; then
-  rm -rf ${LOCAL_BEAM_DIR}
-fi
-mkdir ${LOCAL_BEAM_DIR}
-cd ${LOCAL_BEAM_DIR}
-git clone ${GIT_REPO_URL}
-cd ${BEAM_ROOT_DIR}
-git remote add ${USER_REMOTE_NAME} ${USER_REMOTE_URL}
-git checkout -b ${BRANCH_NAME}
-touch empty_file.txt
-git add -A
-git commit -m "Add empty file in order to create PR"
-git push -f ${USER_REMOTE_NAME}
-
-cd ~/${LOCAL_BEAM_DIR}/${BEAM_ROOT_DIR}
-hub pull-request -F- <<<"[DO NOT MERGE]Start snapshot build for release process
-
-
-Run Gradle Publish"
-
-echo "NOTE: If there is no jenkins job started, please comment generated PR 
with: Run Gradle Publish"
-
-echo "===========================Cleaning up==========================="
-cd ~
-rm -rf ${LOCAL_BEAM_DIR}
-echo "Things remained you need to do manually after build successful:"
-echo "1. Close this generated PR in github website."
-echo "2. Delete your remote branch ${BRANCH_NAME} from your beam repo in 
github website."
diff --git a/website/www/site/content/en/contribute/release-guide.md 
b/website/www/site/content/en/contribute/release-guide.md
index c17cff0353e..1c841b4f6a2 100644
--- a/website/www/site/content/en/contribute/release-guide.md
+++ b/website/www/site/content/en/contribute/release-guide.md
@@ -277,41 +277,20 @@ The key points to know:
 This will all be accomplished by the 
[cut_release_branch](https://github.com/apache/beam/actions/workflows/cut_release_branch.yml)
 workflow.
 
-After cutting the branch, you should manually update `CHANGES.md` on `master` 
by adding a new section for the next release.
-
-#### Use cut_release_branch.sh to cut a release branch
-* **Action:** 
[cut_release_branch](https://github.com/apache/beam/actions/workflows/cut_release_branch.yml)
 (click `run workflow`)
-
-### Start a snapshot build
-
-Start a build of [the nightly 
snapshot](https://ci-beam.apache.org/job/beam_Release_NightlySnapshot/) against 
master branch.
+After updating the master branch, the workflow will also start a build of
+[the nightly 
snapshot](https://ci-beam.apache.org/job/beam_Release_NightlySnapshot/) against 
master branch.
 Some processes, including our archetype tests, rely on having a live SNAPSHOT 
of the current version from the `master` branch.
 Once the release branch is cut, these SNAPSHOT versions are no longer found, 
so builds will be broken until a new snapshot is available.
+The workflow starts the nightly snapshot by creating an empty PR against 
apache:master (which will be linked to in the logs).
 
-There are 2 ways to trigger a nightly build, either using automation 
script(recommended), or perform all operations manually.
-
-#### Run start_snapshot_build.sh to trigger build
-* **Script:** 
[start_snapshot_build.sh](https://github.com/apache/beam/blob/master/release/src/main/scripts/start_snapshot_build.sh)
-
-* **Usage**
+#### Use cut_release_branch.sh to cut a release branch
+* **Action:** 
[cut_release_branch](https://github.com/apache/beam/actions/workflows/cut_release_branch.yml)
 (click `run workflow`)
 
-      ./beam/release/src/main/scripts/start_snapshot_build.sh
-
-* **The script will:**
-  1. Ask for the url of your personal clone of Beam (e.g. 
`https://github.com/<user>/beam`).
-  1. Install [hub](https://github.com/github/hub) with your agreement.
-  1. Touch an empty txt file and commit changes into ```${your remote beam 
repo}/snapshot_build```
-  1. Use hub to create a PR against apache:master, which triggers a Jenkins 
job to build snapshot.
 
 * Tasks you need to do manually to __verify the SNAPSHOT build__
   1. Check whether the Jenkins job gets triggered. If not, please comment 
```Run Gradle Publish``` into the generated PR.
   1. After verifying build succeeded, you need to close PR manually.
-
-#### (Alternative) Do all operations manually
-
-* Find one PR against apache:master in beam.
-* Comment  ```Run Gradle Publish``` in this pull request to trigger build.
-* Verify that build succeeds.
+  1. Manually update `CHANGES.md` on `master` by adding a new section for the 
next release 
([example](https://github.com/apache/beam/commit/96ab1fb3fe07acf7f7dc9d8c829ae36890d1535c)).
 
 
 **********

Reply via email to