-
Notifications
You must be signed in to change notification settings - Fork 35
68 lines (59 loc) · 2.78 KB
/
prepare-release.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
name: Prepare Jib extension release
on:
workflow_dispatch:
inputs:
jib_extension:
description: Jib extension to release
required: true
default: (jib-layer-filter-extension-gradle | ...)
release_version:
description: new release version
required: true
default: (for example, 0.2.0)
jobs:
release:
name: Prepare Jib extension release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2.3.4
- name: Check input
run: |
echo '* input Jib extension: "${{ github.event.inputs.jib_extension }}"'
if [[ ! "${{ github.event.inputs.release_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo 'version "${{ github.event.inputs.release_version }}" not in ###.###.### format'
exit 1
fi
- name: Build Jib extension
run: |
cd first-party
./gradlew clean ${{ github.event.inputs.jib_extension }}:integrationTest --stacktrace
- name: Run Gradle release
run: |
git checkout -b ${{ github.event.inputs.jib_extension }}-release-v${{ github.event.inputs.release_version }}
git config user.email ${{ github.actor }}@users.noreply.github.com
git config user.name ${{ github.actor }}
cd first-party
# This creates the tag (e.g., "v0.2.0-jib-layer-filter-extension-gradle") and pushes the updated
# branch (e.g., "jib-layer-filter-extension-gradle-release-v0.2.0") and the new tag.
./gradlew ${{ github.event.inputs.jib_extension }}:release \
-Prelease.useAutomaticVersion=true \
-Prelease.releaseVersion=${{ github.event.inputs.release_version }}
- name: Create pull request
uses: repo-sync/pull-request@v2.6.2
id: create-pr
with:
github_token: ${{ secrets.CLOUD_JAVA_BOT_GITHUB_TOKEN }}
source_branch: ${{ github.event.inputs.jib_extension }}-release-v${{ github.event.inputs.release_version }}
pr_title: "${{ github.event.inputs.jib_extension }} release v${{ github.event.inputs.release_version }}"
pr_body: "To be merged after the release is complete."
pr_label: "PR: Merge After Release"
- name: Create release checklist issue
uses: JasonEtco/create-an-issue@v2.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: v${{ github.event.inputs.release_version }}-${{ github.event.inputs.jib_extension }}
README_URL: https://github.com/GoogleContainerTools/jib-extensions/blob/master/first-party/${{ github.event.inputs.jib_extension }}/README.md
RELEASE_PR: ${{steps.create-pr.outputs.pr_url}}
with:
filename: .github/RELEASE_TEMPLATES/release_checklist.md