-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 3.03 KB
/
update-repo.yml
File metadata and controls
94 lines (81 loc) · 3.03 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
name: Update Sileo Repo Indexes
on:
push:
branches: [ main ]
paths:
- 'debs/**'
- '.github/workflows/update-repo.yml'
workflow_dispatch: # lets you run it manually from Actions tab too
workflow_run:
workflows:
- "Fetch Aemulo Debs"
- "Build BTLoader (Rootless + Rootful)"
- "Build KettuTweak (Rootless + Rootful)"
- "Build BHTwitter (Rootless + Rootful)"
- "Build SCInsta (Rootless + Rootful)"
types:
- completed
branches:
- main
permissions:
contents: write # needed to commit the updated Packages/Release back
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history so git commit works nicely
- name: Generate Packages file
run: |
dpkg-scanpackages --arch iphoneos-arm debs > Packages || true
dpkg-scanpackages --arch iphoneos-arm64 debs >> Packages || true
- name: Strip unwanted fields from Packages
run: |
sed -i '/^Header:/d; /^Icon:/d; /^SileoDepiction:/d; /^Native-Depiction:/d' Packages
- name: Compress to Packages.bz2 (Sileo prefers this)
run: bzip2 -k -f Packages # -k = keep original, -f = force overwrite
- name: (Optional) Update Release file hashes
run: |
# Simple static Release — you can make this dynamic if needed
cat > Release << EOF
Origin: Silko
Label: Silko
Suite: stable
Version: 1.0
Codename: ios
Architectures: iphoneos-arm iphoneos-arm64
Components: main
Description: Personal repo with tweaks
Date: $(date -Ru)
EOF
# Add MD5/SHA256/SHA512 of Packages* with proper Debian format: hash size filename
echo "MD5Sum:" >> Release
for f in Packages Packages.bz2; do
hash=$(md5sum "$f" | awk '{print $1}')
size=$(wc -c < "$f" | tr -d ' ')
echo " ${hash} ${size} ${f}" >> Release
done
echo "SHA256:" >> Release
for f in Packages Packages.bz2; do
hash=$(sha256sum "$f" | awk '{print $1}')
size=$(wc -c < "$f" | tr -d ' ')
echo " ${hash} ${size} ${f}" >> Release
done
echo "SHA512:" >> Release
for f in Packages Packages.bz2; do
hash=$(sha512sum "$f" | awk '{print $1}')
size=$(wc -c < "$f" | tr -d ' ')
echo " ${hash} ${size} ${f}" >> Release
done
- name: Commit updated indexes back to repo
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add Packages Packages.bz2 Release || true
git commit -m "chore: update Packages & bz2 [ci skip]" || echo "No changes to commit"
git pull --rebase
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # built-in token works here