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