-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathcreate-patch-release-branch.yml
More file actions
105 lines (91 loc) · 3.4 KB
/
Copy pathcreate-patch-release-branch.yml
File metadata and controls
105 lines (91 loc) · 3.4 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Creates a new patch release branch based on the previous release branch
# and increments the patch version in the pom files in the new patch release branch
name: create-patch-release-branch
permissions:
contents: write
on:
workflow_dispatch:
inputs:
release_version:
description: "The release version for which to create a new patch release"
required: true
type: string
dry_run:
description: "Flag indicating whether it is a dry-run or not. When set to true (the default) changes are not persisted."
required: false
type: boolean
default: true
env:
ENV_FILE: .github/workflows/.env
jobs:
create-patch-release-branch:
name: "Create a new patch release branch"
runs-on: ubuntu-latest
steps:
- name: "Checkout current repo for env file and scripts"
if: success()
uses: actions/checkout@v6.0.2
- name: "Verify release version"
if: success()
run: |
bash ./.github/workflows/scripts/common/verify-release-version.sh \
"${{ github.event.inputs.release_version }}" \
"^[0-9]+[.][0-9]+[.][0-9]+$"
- name: "Generate GitHub App token"
id: app-token
uses: actions/create-github-app-token@v3.0.0
with:
app-id: ${{ secrets.OSGP_CI_APP_ID }}
private-key: ${{ secrets.OSGP_CI_APP_PRIVATE_KEY }}
owner: OSGP
- name: "Configure git"
if: success()
run: |
bash ./.github/workflows/scripts/common/configure-git.sh \
$ENV_FILE
env:
TOKEN: ${{ steps.app-token.outputs.token }}
- name: "Checkout repositories"
id: checkout
if: success()
run: |
bash ./.github/workflows/scripts/common/checkout-repositories.sh \
$ENV_FILE
- name: "Update patch release version"
id: patch_version
if: success()
run: |
bash ./.github/workflows/scripts/patch-release/update-patch-version.sh \
"${{ github.event.inputs.release_version }}"
- name: "Verify repositories"
if: success()
run: |
bash ./.github/workflows/scripts/patch-release/verify-repositories.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ github.event.inputs.release_version }}" \
"${{ steps.patch_version.outputs.new }}"
- name: "Create Release Branches"
if: success()
run: |
bash ./.github/workflows/scripts/patch-release/create-release-branches.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ github.event.inputs.release_version }}" \
"${{ steps.patch_version.outputs.new }}"
- name: "Increment pom version"
if: success()
run: |
bash ./.github/workflows/scripts/patch-release/increment-pom-version.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ github.event.inputs.release_version }}" \
"${{ steps.patch_version.outputs.new }}"
- name: "Push changes"
if: success()
run: |
bash ./.github/workflows/scripts/patch-release/push-changes.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ steps.patch_version.outputs.new }}" \
"${{ github.event.inputs.dry_run }}"