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 dpkg-dev jq build-essential - name: Generate dynamic changelog run: | mkdir -p debian # Ensure the debian directory exists sed -e "s/{{VERSION}}/${{ steps.version.outputs.DEB_VERSION }}/g" \ -e "s/{{TAG}}/$GITHUB_REF_NAME/g" \ debian/changelog.in > debian/changelog cat debian/changelog # Debugging: Print the generated changelog - 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}"