Files
furumi-ng/.github/workflows/deb-publish.yml
AB-UK 773e9c1ee7
Some checks failed
Build and Publish Deb Package / build-deb (push) Failing after 9m5s
Publish Server Image / build-and-push-image (push) Has been cancelled
Added deb build
2026-03-13 15:54:08 +00:00

64 lines
1.8 KiB
YAML

name: Build and Publish Deb Package
on:
push:
tags:
- 'v*.*.*'
jobs:
build-deb:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable universe and install dependencies
run: |
sudo add-apt-repository universe -y
sudo apt-get update
sudo apt-get install -y fuse3 libfuse3-dev pkg-config protobuf-compiler cmake
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install cargo-deb
run: cargo install cargo-deb --locked
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Build deb package
run: |
cargo deb -p furumi-mount-linux \
--deb-version ${{ steps.version.outputs.version }}
- name: Locate deb file
id: deb
run: |
DEB=$(ls target/debian/furumi-mount-linux_*.deb | head -1)
echo "path=$DEB" >> "$GITHUB_OUTPUT"
echo "name=$(basename $DEB)" >> "$GITHUB_OUTPUT"
- name: Publish to Gitea APT registry
run: |
curl --fail-with-body \
-X PUT \
-H "Authorization: token ${{ secrets.PKG_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--upload-file "${{ steps.deb.outputs.path }}" \
"${{ secrets.PKG_REGISTRY_URL }}/api/packages/${{ secrets.PKG_OWNER }}/debian/pool/noble/main"