forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (66 loc) · 2.83 KB
/
start_snapshot_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# 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."