-
Notifications
You must be signed in to change notification settings - Fork 21
89 lines (78 loc) · 2.72 KB
/
update-deployment-branches.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
---
name: Update the deployment branches containing the build recipes
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
jobs:
create-pull-requests:
name: create pull requests if the build recipes changed
runs-on: ubuntu-latest
container:
image: ghcr.io/dcermak/bci-ci:latest
options: "--privileged"
strategy:
fail-fast: false
matrix:
os_version:
- 7
- 6
- 5
- "16.0"
- Tumbleweed
steps:
- uses: actions/checkout@v4
with:
# we need all branches for the build checks
fetch-depth: 0
# ensure that we have write permissions for pushes
token: ${{ secrets.CHECKOUT_TOKEN }}
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: poetry-${{ hashFiles('poetry.lock') }}
- name: fix the file permissions of the repository
run: chown -R $(id -un):$(id -gn) .
- name: install python dependencies
run: poetry install
- name: setup the continuous rebuild project
run: poetry run scratch-build-bot --os-version ${{ matrix.os_version }} create_cr_project
env:
OSC_PASSWORD: ${{ secrets.OSC_PASSWORD }}
OSC_USER: "defolos"
- name: configure git user
run: |
git config user.name "SUSE Update Bot"
git config user.email "[email protected]"
- name: commit the changes to a test branch
run: |
set -euo pipefail
poetry run scratch-build-bot \
--os-version ${{ matrix.os_version }} \
-vvvv \
--branch-name "for-deploy-${{ matrix.os_version }}" \
commit_state \
--commit-message "🤖: Update build recipes from templates" \
| tee commit_state_out
if [[ "$(wc -l commit_state_out | awk '{print $1}')" = "1" ]]; then
echo "DEPLOYMENT_COMMIT_HASH=$(cat commit_state_out)" >> $GITHUB_ENV
else
echo "no_change=true" >> $GITHUB_ENV
fi
cat test-build.env >> $GITHUB_ENV
env:
OSC_USER: "defolos"
OSC_PASSWORD: ${{ secrets.OSC_PASSWORD }}
- name: create a pull request
uses: vsoch/pull-request-action@master
id: create-pr
env:
GITHUB_TOKEN: ${{ secrets.CHECKOUT_TOKEN }}
PULL_REQUEST_FROM_BRANCH: ${{ env.BRANCH_NAME }}
PULL_REQUEST_BRANCH: ${{ env.DEPLOYMENT_BRANCH_NAME }}
PULL_REQUEST_TITLE: "🤖: Update build recipes for ${{ env.OS_VERSION_PRETTY }}"
PULL_REQUEST_UPDATE: 1
PULL_REQUEST_REVIEWERS: "fcrozat PVlasin dirkmueller"
if: env.no_change != 'true'