-
Notifications
You must be signed in to change notification settings - Fork 0
206 lines (184 loc) · 6.48 KB
/
build_bootstrap_images_aarch64.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: 🐬 Push Bootstrap Images (aarch64) 🐬
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 */8 * * *" # Every 08 Hrs
jobs:
push-aarch64:
#runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
timeout-minutes: 200
permissions:
attestations: write
contents: write
id-token: write
packages: write
statuses: read
strategy:
matrix:
include:
- image: "alpine-base"
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/alpine.sh"
arch: "aarch64"
file: "/tmp/rootfs.tar"
- image: "archlinux-base"
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/archlinux.sh"
arch: "aarch64"
file: "/tmp/rootfs.tar"
#- image: "artix-base"
# script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/artix.sh"
# arch: "aarch64"
# file: "/tmp/rootfs.tar"
#- image: "cachyos-base"
# script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/cachyos.sh"
# arch: "aarch64"
# file: "/tmp/rootfs.tar"
- image: "debian-base"
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/debian.sh"
arch: "aarch64"
file: "/tmp/rootfs.tar"
- image: "eweos-base"
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/eweos.sh"
arch: "aarch64"
file: "/tmp/rootfs.tar"
- image: "ubuntu-base"
script: "${GITHUB_WORKSPACE}/main/Github/Runners/bootstrap/ubuntu.sh"
arch: "aarch64"
file: "/tmp/rootfs.tar"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: main
filter: "blob:none"
- name: Debloat Runner
run: |
#Presets
set +x ; set +e
#--------------#
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/debloat_ubuntu.sh")
continue-on-error: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
continue-on-error: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
continue-on-error: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
continue-on-error: true
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
continue-on-error: true
- name: Install Addons
run: |
#presets
set +x ; set +e
#-------------#
bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Linux/install_bins_curl.sh")
continue-on-error: true
- name: Setup Env
run: |
#presets
set +x ; set +e
#-------------#
#tmp
SYSTMP="$(dirname $(mktemp -u))" && export SYSTMP="${SYSTMP}"
echo "SYSTMP=${SYSTMP}" >> "${GITHUB_ENV}"
#-------------#
##User-Agent
USER_AGENT="$(curl -qfsSL 'https://pub.ajam.dev/repos/Azathothas/Wordlists/Misc/User-Agents/ua_chrome_macos_latest.txt')" && export USER_AGENT="${USER_AGENT}"
echo "USER_AGENT=${USER_AGENT}" >> "${GITHUB_ENV}"
continue-on-error: true
- name: Push (${{ matrix.image }}/${{ matrix.arch }})
env:
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
run: |
#presets
set +x ; set +e
#-------------#
dos2unix --quiet "${{ matrix.script }}"
chmod +x "${{ matrix.script }}"
bash "${{ matrix.script }}"
continue-on-error: true
- name: Check
run: |
#presets
set +x ; set +e
#-------------#
if [[ -s "${{ matrix.file }}" ]] && [[ $(stat -c%s "${{ matrix.file }}") -gt 10000 ]]; then
export HAS_IMAGE="TRUE"
echo "HAS_IMAGE=${HAS_IMAGE}" >> "${GITHUB_ENV}"
UTC_TIME="$(TZ='UTC' date +'%Y_%m_%d')"
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
else
export HAS_IMAGE="FALSE"
echo "HAS_IMAGE=${HAS_IMAGE}" >> "${GITHUB_ENV}"
fi
continue-on-error: true
- name: Fail (If Push Failed)
if: env.HAS_IMAGE == 'FALSE'
run: |
#presets
set +x ; set +e
#-------------#
exit 1
continue-on-error: false
#Artifacts
- name: Upload (Build) Artifacts
if: env.HAS_IMAGE == 'TRUE'
uses: actions/upload-artifact@v4
with:
name: "ARTIFACTS-${{ matrix.image }}_${{ matrix.arch }}"
path: |
${{ matrix.file }}
compression-level: 0 #no compression, [Default: 6 (GNU Gzip)]
retention-days: 90 #max
overwrite: true
continue-on-error: true
#continuous
- name: Releaser (Continuous)
if: env.HAS_IMAGE == 'TRUE'
uses: softprops/action-gh-release@v2.2.1
with:
name: "Continuous ${{ matrix.image }}_${{ matrix.arch }}"
tag_name: "${{ matrix.image }}_${{ matrix.arch }}"
prerelease: true
draft: false
generate_release_notes: false
files: |
${{ matrix.file }}
continue-on-error: true
#Snapshot
- name: Releaser (Snapshot)
if: env.HAS_IMAGE == 'TRUE'
uses: softprops/action-gh-release@v2.2.1
with:
name: "Snapshot-(${{ matrix.image }}_${{ matrix.arch }}_${{ env.UTC_TIME }}"
tag_name: "${{ matrix.image }}_${{ matrix.arch }}_${{ env.UTC_TIME }}"
prerelease: false
draft: false
generate_release_notes: false
make_latest: false
files: |
${{ matrix.file }}
continue-on-error: true
#Build Provenance
- name: Attest Build Provenance
if: env.HAS_IMAGE == 'TRUE'
uses: actions/attest-build-provenance@v2.2.0
with:
subject-name: "image-${{ matrix.image }}-${{ matrix.arch }}"
subject-path: ${{ matrix.file }}
show-summary: true
continue-on-error: true