From 3d4491a771c5c7cc15729c831f3680a4c4239fe3 Mon Sep 17 00:00:00 2001 From: chersbobers Date: Wed, 13 May 2026 17:32:31 +1200 Subject: [PATCH] Just set it up for the mirrors --- .forgejo/workflows/hasher.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 3 +++ 2 files changed, 35 insertions(+) create mode 100644 .forgejo/workflows/hasher.yml create mode 100644 package.json diff --git a/.forgejo/workflows/hasher.yml b/.forgejo/workflows/hasher.yml new file mode 100644 index 0000000..d21111c --- /dev/null +++ b/.forgejo/workflows/hasher.yml @@ -0,0 +1,32 @@ +name: Hasher +on: [push] + +jobs: + generate-metadata: + runs-on: docker + steps: + - uses: actions/checkout@v3 + + - name: Build Manifest + run: | + echo '{"packages": [' > packages.json + DIRS=$(find . -maxdepth 1 -type d -not -path '*/.*' -not -path '.') + FIRST=true + for DIR in $DIRS; do + PKG=$(basename "$DIR") + if [ -f "$DIR/$PKG.c" ]; then + sha256sum "$DIR/$PKG.c" | cut -d ' ' -f 1 > "$DIR/$PKG.hash" + if [ "$FIRST" = false ]; then echo "," >> packages.json; fi + echo "{\"name\": \"$PKG\", \"version\": \"1.0.0\"}" >> packages.json + FIRST=false + fi + done + echo ']}' >> packages.json + + - name: Deploy Changes + run: | + git config --local user.email "hasher@forgejo.internal" + git config --local user.name "Hasher Bot" + git add . + git commit -m "hasher: auto-update" || exit 0 + git push \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..897f681 --- /dev/null +++ b/package.json @@ -0,0 +1,3 @@ +{ + "packages": [] +} \ No newline at end of file