add build workflow
Some checks failed
Build and Deploy Debian Package / build-package (push) Failing after 20s

This commit is contained in:
Marco Realacci 2025-01-28 19:02:32 +01:00
parent 9dfd9ebfcf
commit 7c218fc664
7 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,44 @@
name: Build and Deploy Debian Package
on:
push:
tags:
- '*'
jobs:
build-package:
runs-on: docker
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Parse distribution
run: |
if [[ "$GITHUB_REF_NAME" == *"@stable"* ]]; then
echo "DISTRO=stable" >> $GITHUB_ENV
else
echo "DISTRO=unstable" >> $GITHUB_ENV
fi
- name: Setup Debian Packaging
run: |
sudo apt-get update
sudo apt-get install -y devscripts debhelper dh-python dh-systemd build-essential
- name: Build Debian Package
run: |
debuild -us -uc -b
- name: Upload to Forgejo Debian Registry
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: |
PACKAGE_NAME="magicfw_0.1.0-1_all.deb" # Update version accordingly
DISTRO="debian" # e.g., bullseye, bookworm
COMPONENT="main"
curl --user "your_username:$FORGEJO_TOKEN" \
--upload-file ../${PACKAGE_NAME} \
"https://git.marcorealacci.me/api/packages/${{ github.repository_owner }}/debian/pool/${DISTRO}/${COMPONENT}/${PACKAGE_NAME}"

5
debian/changelog.in vendored Normal file
View file

@ -0,0 +1,5 @@
magicfw ({{VERSION}}) unstable; urgency=medium
* Automatic release from Git tag {{TAG}}
-- Auto Release Bot <ci@forgejo> $(date -R)

12
debian/control vendored Normal file
View file

@ -0,0 +1,12 @@
Source: magicfw
Section: utils
Priority: optional
Maintainer: Marco Realacci <marco@marcorealacci.me>
Build-Depends: debhelper-compat (= 13), dh-python, python3-all
Standards-Version: 4.6.0
Package: magicfw
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}
Description: A magic firewall service
Automatic build from Git tag ${TAG}.

2
debian/install vendored Normal file
View file

@ -0,0 +1,2 @@
src/main.py usr/bin/
systemd/magicfw.service lib/systemd/system/

3
debian/rules vendored Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@ --with python3,systemd --buildsystem=pybuild

1
debian/source/format vendored Normal file
View file

@ -0,0 +1 @@
3.0 (quilt)