forked from manjaro/release-review
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (154 loc) · 5.63 KB
/
iso_build.yaml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: x86 Builds
on:
schedule:
- cron: '30 17 * * *'
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/iso_build.yaml
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
MATRIX_ROOM_ID: "!XXstZzLEcUVKyTcqCA:matrix.org"
MIRROR: https://opencolo.mm.fcix.net/manjaro
jobs:
prepare-release:
runs-on: ubuntu-22.04
steps:
- id: time
uses: boredland/get-time-action@dbc808befb89eb33fee64f5f4abce4d2a5fa7cfd # tag=2.0.0
with:
format: 'YYYYMMDDHHmm'
- id: kernel
uses: boredland/kernel-info@main
outputs:
release_tag: rc-${{ steps.time.outputs.time }}
longterm: ${{ steps.kernel.outputs.longterm-pkg }}
stable: ${{ steps.kernel.outputs.stable-pkg }}
build-stable:
runs-on: ubuntu-22.04
needs: [prepare-release]
name: stable x86_64 ${{ matrix.edition }}
permissions:
contents: write
actions: read
strategy:
fail-fast: false
matrix:
edition:
- kde
- xfce
- gnome
- i3
- cinnamon
- sway
include:
- repo: https://gitlab.manjaro.org/profiles-and-settings/iso-profiles.git
- edition: kde
mention: "@lordtermor:matrix.org"
- edition: xfce
mention: "@daphilly:matrix.org"
- edition: gnome
mention: "@yochananmarqos:matrix.org"
- edition: i3
mention: "@oberon-manjaro:matrix.org"
- edition: cinnamon
mention: "@oberon-manjaro:matrix.org"
- edition: sway
mention: "@boredland:matrix.org"
repo: https://github.com/manjaro-sway/iso-profiles
steps:
- name: x86_64 build
uses: manjaro-contrib/action-buildiso@main
with:
iso-profiles-repo: ${{ matrix.repo }}
edition: ${{ matrix.edition }}
branch: stable
scope: full
kernel: ${{ needs.prepare-release.outputs.longterm }}
release-tag: ${{ needs.prepare-release.outputs.release_tag }}
build-mirror: ${{ env.MIRROR }}
gpg-secret-key-base64: ${{ secrets.GPG_KEY_BASE64 }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
- uses: Tiryoh/[email protected]
id: url
if: failure()
with:
github_token: ${{ github.token }}
job_name: 'stable x86_64 ${{ matrix.edition }}'
- uses: s3krit/[email protected]
if: failure()
with:
room_id: ${{ env.MATRIX_ROOM_ID}}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "🚨 Error building **${{ matrix.edition }}** for **x86** (**stable**). Summon ${{ matrix.mention }} to check the [logs](${{ steps.url.outputs.html_url }}) 🪄"
server: "matrix.org"
build-next:
runs-on: ubuntu-22.04
needs: [prepare-release]
name: ${{ matrix.branch }} x86_64 ${{ matrix.edition }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
branch: [unstable]
edition:
- kde-dev
- xfce
- gnome-next
- i3
- cinnamon
- sway
include:
- repo: https://gitlab.manjaro.org/profiles-and-settings/iso-profiles.git
- edition: sway
repo: https://github.com/manjaro-sway/iso-profiles
steps:
- name: x86_64 build
uses: manjaro-contrib/action-buildiso@main
with:
iso-profiles-repo: ${{ matrix.repo }}
edition: ${{ matrix.edition }}
branch: ${{ matrix.branch }}
scope: full
kernel: ${{ needs.prepare-release.outputs.stable }}
release-tag: ${{ needs.prepare-release.outputs.release_tag }}
build-mirror: ${{ env.MIRROR}}
gpg-secret-key-base64: ${{ secrets.GPG_KEY_BASE64 }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
announce:
runs-on: ubuntu-22.04
needs: [prepare-release, build-stable]
if: needs.build-stable.result == 'success'
steps:
- uses: s3krit/[email protected]
with:
room_id: ${{ env.MATRIX_ROOM_ID}}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "🚀 Success building for **x86** (stable): Should we do a release? Check out [those](https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare-release.outputs.release_tag }}) assets!"
server: "matrix.org"
rollback:
runs-on: ubuntu-22.04
needs: [prepare-release, build-stable, build-next]
if: cancelled() || failure()
steps:
- uses: actions/checkout@v4
- name: rollback
run: |
echo ${{ github.token }} | gh auth login --with-token
ASSET_COUNT=$(gh release view ${{ needs.prepare-release.outputs.release_tag }} --json "assets" --jq '.assets | length')
# If we have more than the two tarballs github creates, we can delete the release - there is nothing to inspect
if [ "$ASSET_COUNT" -gt "2" ]; then exit 0;fi
gh release delete ${{ needs.prepare-release.outputs.release_tag }} -y --repo ${{ github.repository }}
git push --delete origin ${{ needs.prepare-release.outputs.release_tag }}
- uses: s3krit/[email protected]
if: ${{ needs.build-stable.result == 'failure' }}
with:
room_id: ${{ env.MATRIX_ROOM_ID}}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "😬 Error building for **x86**: Please have a look into the [logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"
server: "matrix.org"