commit 31a8301b188eeec6fa57e48efb386dcf4a897118 parent c7e497bdd1864ccec30a472a151f043d46cfcb2a Author: Minerva_juppiter <94231606+minerva-jupiter@users.noreply.github.com> Date: Wed, 29 Jul 2026 20:53:49 +0900 Add workflow for building and publishing Debian packages This workflow builds and publishes Debian packages for multiple Rust projects on a schedule and via manual dispatch. It includes steps for checking out the repository, setting up Rust, installing cargo-deb, building packages, and deploying to GitHub Pages. Diffstat:
| A | .github/workflows/cargo-deb.yaml | | | 117 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 117 insertions(+), 0 deletions(-)
diff --git a/.github/workflows/cargo-deb.yaml b/.github/workflows/cargo-deb.yaml @@ -0,0 +1,117 @@ +name: Build and Publish Debian Packages + +on: + schedule: + - cron: '37 15 * * *' + workflow_dispatch: + +permissions: + contents: write + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - name: nushell + type: github-release + repo: nushell/nushell + bin: nu + - name: starship + type: github-release + repo: starship/starship + bin: starship + - name: zellij + type: github-release + repo: zellij-org/zellij + bin: zellij + - name: gemini-commit-message + type: git-head + repo: minerva-jupiter/gemini-commit-message + bin: gemini-commit-message + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install cargo-deb + run: cargo install cargo-deb + + - name: Build package (${{ matrix.name }}) + id: build_pkg + run: | + mkdir -p build_work + cd build_work + + if [ "${{ matrix.type }}" = "github-release" ]; then + LATEST_TAG=$(curl -s "https://api.github.com/repos/${{ matrix.repo }}/releases/latest" | jq -r .tag_name) + echo "Latest tag for ${{ matrix.name }}: $LATEST_TAG" + git clone --depth 1 --branch "$LATEST_TAG" "https://github.com/${{ matrix.repo }}.git" source + else + git clone --depth 1 "https://github.com/${{ matrix.repo }}.git" source + fi + + cd source + cargo deb + + mkdir -p ../../debs + cp target/debian/*.deb ../../debs/ + + - name: Upload built deb artifact + uses: actions/upload-artifact@v4 + with: + name: deb-${{ matrix.name }} + path: debs/*.deb + + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Download all deb artifacts + uses: actions/download-artifact@main + with: + pattern: deb-* + path: public + merge-multiple: true + + - name: Generate APT Index (Packages.gz & Release) + run: | + cd public + dpkg-scanpackages . /dev/null > Packages + gzip -9c Packages > Packages.gz + + cat <<EOF > Release + Origin: deb-collections + Label: deb-collections + Suite: stable + Codename: stable + Architectures: amd64 + Components: main + Description: Personal APT Repository + EOF + + - name: Setup Pages + uses: actions/configure-pages@main + + - name: Upload artifact for GitHub Pages + uses: actions/upload-pages-artifact@main + with: + path: public + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4