-
Notifications
You must be signed in to change notification settings - Fork 1
179 lines (162 loc) · 5.79 KB
/
create_x86_64-Linux.yaml
File metadata and controls
179 lines (162 loc) · 5.79 KB
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
name: 🐬 Create RunImage Images (x86_64) 🐬
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 10 1/7 * *" # Every week
jobs:
push-x86_64:
runs-on: ubuntu-latest
timeout-minutes: 200
permissions:
attestations: write
contents: write
id-token: write
packages: write
statuses: read
strategy:
matrix:
include:
- image: "alpine"
script: "${GITHUB_WORKSPACE}/main/alpine.sh"
arch: "x86_64"
file: "/tmp/runimage"
- image: "archlinux"
script: "${GITHUB_WORKSPACE}/main/archlinux.sh"
arch: "x86_64"
file: "/tmp/runimage"
- image: "artix"
script: "${GITHUB_WORKSPACE}/main/artix.sh"
arch: "x86_64"
file: "/tmp/runimage"
- image: "cachyos"
script: "${GITHUB_WORKSPACE}/main/cachyos.sh"
arch: "x86_64"
file: "/tmp/runimage"
- image: "debian"
script: "${GITHUB_WORKSPACE}/main/debian.sh"
arch: "x86_64"
file: "/tmp/runimage"
- image: "eweos"
script: "${GITHUB_WORKSPACE}/main/eweos.sh"
arch: "x86_64"
file: "/tmp/runimage"
- image: "ubuntu"
script: "${GITHUB_WORKSPACE}/main/ubuntu.sh"
arch: "x86_64"
file: "/tmp/runimage"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: main
filter: "blob:none"
- name: Setup Env
run: |
#presets
set +x ; set +e
#-------------#
##CoreUtils
sudo apt update -y
sudo apt install bc coreutils curl dos2unix fdupes jq moreutils wget -y
sudo apt-get install apt-transport-https apt-utils ca-certificates coreutils dos2unix gnupg2 jq moreutils p7zip-full rename rsync software-properties-common texinfo tmux util-linux wget -y 2>/dev/null ; sudo apt-get update -y 2>/dev/null
#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: Disable apparmor_restrict_unprivileged_userns
run: |
#presets
set +x ; set +e
#-------------#
echo "kernel.apparmor_restrict_unprivileged_userns=0" | sudo tee "/etc/sysctl.d/98-apparmor-unuserns.conf"
echo "0" | sudo tee "/proc/sys/kernel/apparmor_restrict_unprivileged_userns"
sudo service procps restart
sudo sysctl -p "/etc/sysctl.conf"
continue-on-error: true
- name: Create (${{ matrix.image }}/${{ matrix.arch }})
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_RUNIMAGE="TRUE"
echo "HAS_RUNIMAGE=${HAS_RUNIMAGE}" >> "${GITHUB_ENV}"
UTC_TIME="$(TZ='UTC' date +'%Y_%m_%d')"
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
else
export HAS_RUNIMAGE="FALSE"
echo "HAS_RUNIMAGE=${HAS_RUNIMAGE}" >> "${GITHUB_ENV}"
fi
continue-on-error: true
- name: Fail (If Create Failed)
if: env.HAS_RUNIMAGE == 'FALSE'
run: |
#presets
set +x ; set +e
#-------------#
exit 1
continue-on-error: false
#Artifacts
- name: Upload (Build) Artifacts
if: env.HAS_RUNIMAGE == '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_RUNIMAGE == '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_RUNIMAGE == '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_RUNIMAGE == 'TRUE'
uses: actions/attest-build-provenance@v2.2.3
with:
subject-name: "image-${{ matrix.image }}-${{ matrix.arch }}"
subject-path: ${{ matrix.file }}
show-summary: true
continue-on-error: true