Update Sileo Repo Indexes #50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 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 |