-
Notifications
You must be signed in to change notification settings - Fork 0
177 lines (163 loc) · 5.78 KB
/
fetch_releases.yaml
File metadata and controls
177 lines (163 loc) · 5.78 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
name: 🐬 Fetch Releases 🐬
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 */6 * * *" # Every 06 Hrs
jobs:
fetch-sync:
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
permissions:
attestations: write
contents: write
id-token: write
packages: write
statuses: read
strategy:
fail-fast: false
matrix:
include:
- title: "astral-glibc"
script: "${GITHUB_WORKSPACE}/main/fetch_astral_glibc.sh"
arch: "aarch64"
file: "/tmp/python.tar"
runner: "ubuntu-24.04-arm"
- title: "astral-glibc"
script: "${GITHUB_WORKSPACE}/main/fetch_astral_glibc.sh"
arch: "x86_64"
file: "/tmp/python.tar"
runner: "ubuntu-latest"
#No musl builds yet
#- title: "astral-musl"
# script: "${GITHUB_WORKSPACE}/main/fetch_astral_musl.sh"
# arch: "aarch64"
# file: "/tmp/python.tar"
# runner: "ubuntu-24.04-arm"
- title: "astral-musl"
script: "${GITHUB_WORKSPACE}/main/fetch_astral_musl.sh"
arch: "x86_64"
file: "/tmp/python.tar"
runner: "ubuntu-latest"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: main
fetch-depth: "1"
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
#Git
sudo apt-get install git-lfs -y -qq
echo "GH_PAGER=" >> "${GITHUB_ENV}"
gh config set prompt disabled
#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: 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: Fetch (${{ matrix.title }}/${{ matrix.arch }})
env:
GHCR_TOKEN: "${{ github.token }}"
GITHUB_TOKEN: "${{ github.token }}"
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 1000 ]]; then
export HAS_RELEASE="TRUE"
echo "HAS_RELEASE=${HAS_RELEASE}" >> "${GITHUB_ENV}"
UTC_TIME="$(TZ='UTC' date +'%Y_%m_%d')"
echo "UTC_TIME=${UTC_TIME}" >> "${GITHUB_ENV}"
else
export HAS_RELEASE="FALSE"
echo "HAS_RELEASE=${HAS_RELEASE}" >> "${GITHUB_ENV}"
fi
continue-on-error: true
- name: Fail (If Create Failed)
if: env.HAS_RELEASE == 'FALSE'
run: |
#presets
set +x ; set +e
#-------------#
exit 1
continue-on-error: false
#Artifacts
- name: Upload (Build) Artifacts
if: env.HAS_RELEASE == 'TRUE'
uses: actions/upload-artifact@v4
with:
name: "ARTIFACTS-${{ matrix.title }}_${{ 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_RELEASE == 'TRUE'
uses: softprops/action-gh-release@v2.2.1
with:
name: "Continuous ${{ matrix.title }}_${{ matrix.arch }}"
tag_name: "${{ matrix.title }}_${{ matrix.arch }}"
prerelease: true
draft: false
generate_release_notes: false
body_path: "/tmp/RELEASE_NOTE.md"
files: |
${{ matrix.file }}
continue-on-error: true
#Snapshot
- name: Releaser (Snapshot)
if: env.HAS_RELEASE == 'TRUE'
uses: softprops/action-gh-release@v2.2.1
with:
name: "Snapshot-(${{ matrix.title }}_${{ matrix.arch }}_${{ env.UTC_TIME }}"
tag_name: "${{ matrix.title }}_${{ matrix.arch }}_${{ env.UTC_TIME }}"
prerelease: false
draft: false
generate_release_notes: false
make_latest: false
body_path: "/tmp/RELEASE_NOTE.md"
files: |
${{ matrix.file }}
continue-on-error: true
#Build Provenance
- name: Attest Build Provenance
if: env.HAS_RELEASE == 'TRUE'
uses: actions/attest-build-provenance@v2.2.0
with:
subject-name: "${{ matrix.title }}-${{ matrix.arch }}"
subject-path: ${{ matrix.file }}
show-summary: true
continue-on-error: true