-
Notifications
You must be signed in to change notification settings - Fork 2
93 lines (77 loc) · 4.13 KB
/
prepare-for-minor-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
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
name: Prepare for minor release
run-name: Update az-quickstart-scaffolding repository for new `${{ github.event.client_payload.release_branch_name }}` minor release branch.
on:
repository_dispatch:
types: az_quickstart_prep_for_minor_release
jobs:
prepare_for_new_minor_release:
runs-on: ubuntu-latest
steps:
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: composer:v2
- name: Checkout az-quickstart-scaffolding
uses: actions/checkout@v4
- name: Set up git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Create new release branch and push it back to the repo.
run: |
git checkout -b ${{ github.event.client_payload.release_branch_name }}
git push -u origin ${{ github.event.client_payload.release_branch_name }}
- name: Create new branch so we can make a pull request against `${{ github.event.client_payload.release_branch_name }}`
run: |
git checkout -b ${{ github.event.client_payload.release_branch_name }}-prepare-for-minor-release
- name: Update quickstart_branch.sh in release branch
run: |
NEW_VERSION=${{ github.event.client_payload.release_branch_name }}
sed -i "s/BRANCH=main/BRANCH=$NEW_VERSION/g" quickstart_branch.sh
- name: Update Lando config in release branch
run: |
NEW_VERSION=${{ github.event.client_payload.release_branch_name }}
sed -i "s/PROFILE_BRANCH=main/PROFILE_BRANCH=$NEW_VERSION/g" .lando.yml
sed -i "s/default: main/default: $NEW_VERSION/g" .lando.yml
- name: Update Probo config in release branch
run: |
NEW_VERSION=${{ github.event.client_payload.release_branch_name }}
sed -i "s/PROFILE_BRANCH=main/PROFILE_BRANCH=$NEW_VERSION/g" .probo.yaml
- name: Add changed files to release branch commit
run: |
git add quickstart_branch.sh
git add .lando.yml
git add .probo.yaml
- name: Add composer.json change to commit for release branch PR
run: |
git add composer.json
git commit -m "Update Quickstart version constraint to ${{ github.event.client_payload.this_release_branch_alias_constraint }}"
- name: Push required changes to new branch so we can make a pull request
uses: peter-evans/create-pull-request@v5
with:
title: Prepare repository for new minor release branch ${{ inputs.release_branch_name }}
commit-message: Prepare repository for new minor release branch ${{ inputs.release_branch_name }}
branch: ${{ github.event.client_payload.release_branch_name }}-prepare-for-minor-release
base: ${{ github.event.client_payload.release_branch_name }}
delete-branch: true
- name: Checkout az-quickstart-scaffolding
uses: actions/checkout@v4
- name: Create branch from main to prepare for release
run: |
git checkout -b prepare-main-for-${{ github.event.client_payload.release_branch_name }}
- name: Update the az-digital/az_quickstart composer.json requirement on main branch
run: |
composer require az-digital/az_quickstart ${{ github.event.client_payload.next_release_branch_alias_constraint }} --no-update --no-scripts --no-interaction
- name: Add composer.json change to commit for main branch PR
run: |
git add composer.json
git commit -m "Update Quickstart version constraint to ${{ github.event.client_payload.next_release_branch_alias_constraint }}"
- name: Push required changes to new branch so we can make a pull request
uses: peter-evans/create-pull-request@v5
with:
title: Prepare repository for new minor release branch ${{ inputs.release_branch_name }}
commit-message: Prepare repository for new minor release branch ${{ inputs.release_branch_name }}
branch: prepare-main-for-${{ github.event.client_payload.release_branch_name }}
base: main
delete-branch: true