-
Notifications
You must be signed in to change notification settings - Fork 41
103 lines (89 loc) · 3.24 KB
/
Copy pathcreate-release-branch.yml
File metadata and controls
103 lines (89 loc) · 3.24 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
# Creates a new release branch based on the development branch
# and increases the minor version in the pom files in the development branch
name: create-release-branch
permissions:
contents: write
on:
workflow_dispatch:
inputs:
release_version:
description: "The release version to create (in «major».«minor».«patch» format)."
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-release-branch:
name: "Create a new 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$"
- 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"
if: success()
id: checkout
run: |
bash ./.github/workflows/scripts/common/checkout-repositories.sh \
$ENV_FILE
- name: "Verify repositories"
if: success()
run: |
bash ./.github/workflows/scripts/release/verify-repositories.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ github.event.inputs.release_version }}"
- name: "Update minor release version"
id: minor_version
if: success()
run: |
bash ./.github/workflows/scripts/release/update-minor-version.sh \
"${{ github.event.inputs.release_version }}"
- name: "Create release branches"
if: success()
run: |
bash ./.github/workflows/scripts/release/create-release-branches.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ github.event.inputs.release_version }}"
- name: "Increment pom version"
if: success()
run: |
bash ./.github/workflows/scripts/release/increment-pom-version.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ github.event.inputs.release_version }}" \
"${{ steps.minor_version.outputs.new }}" \
- name: "Push changes"
if: success()
run: |
bash ./.github/workflows/scripts/release/push-changes.sh \
$ENV_FILE \
"${{ steps.checkout.outputs.repo_dir }}" \
"${{ github.event.inputs.release_version }}" \
"${{ github.event.inputs.dry_run }}"