Some checks failed
Build and Deploy Debian Package / build-package (push) Failing after 57s
67 lines
No EOL
2.2 KiB
YAML
67 lines
No EOL
2.2 KiB
YAML
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: |
|
|
VERSION=${{ github.ref_name#v }} # Rimuove il prefisso "v" dal tag
|
|
DISTRIBUTION=$DISTRO # Dalla variabile impostata in "Parse distribution"
|
|
|
|
# Configura dch per generare il changelog
|
|
dch --create \
|
|
--package magicfw \
|
|
--newversion "$VERSION" \
|
|
--distribution "$DISTRIBUTION" \
|
|
"Automatic release from Git tag ${GITHUB_REF_NAME}"
|
|
|
|
# Debug: Mostra il contenuto del changelog generato
|
|
cat debian/changelog
|
|
|
|
# - 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}" |