-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (70 loc) · 2.68 KB
/
nightly.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
name: 🌑️ Nightly builds
# Create nightly builds at the end of every day
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
##################################
###### APT/DNF commit check ######
##################################
check:
name: 🔀 Compare Repository with current master
runs-on: ubuntu-latest
outputs:
build-apt-nightly: ${{ steps.apt-build-necessary.outputs.commit-has-changed }}
build-dnf-nightly: ${{ steps.dnf-build-necessary.outputs.commit-has-changed }}
current-head-sha: ${{ steps.determine-head-sha.outputs.head-sha }}
steps:
- name: ⬇ Get current master head sha
id: determine-head-sha
run: echo "head-sha=$(git ls-remote https://github.com/hyperion-project/hyperion.ng HEAD | cut -f 1)" >> $GITHUB_OUTPUT
- name: ✅ Check if commit has changed (APT)
id: apt-build-necessary
run: |
if wget --spider "https://nightly.apt.releases.hyperion-project.org/${{ steps.determine-head-sha.outputs.head-sha }}" 2>/dev/null; then
echo "commit-has-changed=false" >> $GITHUB_OUTPUT
else
echo "commit-has-changed=true" >> $GITHUB_OUTPUT
fi
- name: ✅ Check if commit has changed (DNF)
id: dnf-build-necessary
run: |
if wget --spider "https://nightly.dnf.releases.hyperion-project.org/${{ steps.determine-head-sha.outputs.head-sha }}" 2>/dev/null; then
echo "commit-has-changed=false" >> $GITHUB_OUTPUT
else
echo "commit-has-changed=true" >> $GITHUB_OUTPUT
fi
# Build DEB Packages for APT Repository
deb_build:
name: 👷 Build DEB Packages
if: ${{ needs.check.outputs.build-apt-nightly == 'true' }}
needs: [check]
uses: ./.github/workflows/build_deb.yml
secrets: inherit
with:
head_sha: ${{ needs.check.outputs.current-head-sha }}
nightly: true
upload: true
# Build RPM Packages for DNF Repository
rpm_build:
name: 👷 Build RPM Packages
if: ${{ needs.check.outputs.build-dnf-nightly == 'true' }}
needs: [check]
uses: ./.github/workflows/build_rpm.yml
secrets: inherit
with:
head_sha: ${{ needs.check.outputs.current-head-sha }}
nightly: true
upload: true
# Publish RPM Packages to DNF Repository
publish_packages:
name: 🚀 Publish Packages
if: ${{ needs.check.outputs.build-apt-nightly == 'true' || needs.check.outputs.build-dnf-nightly == 'true' }}
needs: [ check, deb_build, rpm_build ]
uses: ./.github/workflows/publish_deb_rpm.yml
secrets: inherit
with:
head_sha: ${{ needs.check.outputs.current-head-sha }}
nightly: true
publish: true