-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.52 KB
/
daily-copr.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
name: Daily COPR
on:
schedule:
- cron: "30 6 * * 1-5"
workflow_dispatch:
jobs:
update_rpm:
runs-on: ubuntu-latest
name: Update RPM
permissions:
contents: write
timeout-minutes: 5
env:
UPDATE_STATUS: "current"
COPR_STATUS: "succeeded"
steps:
- uses: actions/checkout@v4
- name: Update RPM
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
# Update spec with HEAD commit of dependencies
source ./scripts/update-rpm.sh --print-spec
# Check copr build
source ./scripts/status-copr.sh --no-fail
# Output status to env
echo "UPDATE_STATUS=$update_status" >> $GITHUB_ENV
echo "COPR_STATUS=$build_state" >> $GITHUB_ENV
- name: Checkout submodules
if: ${{ env.UPDATE_STATUS == 'updated' }}
run: |
bash ./scripts/checkout-deps.sh
- name: Commit changes
if: ${{ env.UPDATE_STATUS == 'updated' }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "CI"
git commit -a -m "build(github-actions): automated update [skip ci]"
- name: Push changes
if: ${{ env.UPDATE_STATUS == 'updated' }}
uses: ad-m/github-push-action@master
- name: Build on COPR
if: ${{ env.UPDATE_STATUS == 'updated' || env.COPR_STATUS == 'failed' }}
env:
COPR_WEBHOOK: ${{ secrets.COPR_WEBHOOK }}
run: |
curl -X POST $COPR_WEBHOOK