extra-packages/.forgejo/workflows/pylogbeat.yaml
Christoph Heiss 0d273c99d0
Some checks failed
python3-pylogbeat / build-deb (push) Successful in 52s
python3-logstash-async / build-deb (push) Successful in 46s
spdlog / build-deb (map[runs-on-image:node-24-arm64]) (push) Failing after 2m31s
ci: switch to forgejo debian registry
Signed-off-by: Christoph Heiss <christoph.heiss@robo4you.at>
2025-05-30 19:20:17 +02:00

97 lines
2.6 KiB
YAML

---
name: python3-pylogbeat
on:
push:
branches:
- master
paths:
- .forgejo/workflows/pylogbeat.yaml
pull_request:
paths:
- .forgejo/workflows/pylogbeat.yaml
env:
REPO: https://github.com/eht16/pylogbeat
PKGNAME: python3-pylogbeat
UPSTREAM_VER: '2.0.1'
EXTRA_VER: compair3
jobs:
build-deb:
runs-on: node-24
steps:
- name: Checkout pylogbeat
env:
TAG: '${{ env.UPSTREAM_VER }}'
run: |
git config --global --add safe.directory $PWD
git init
git remote add origin "$REPO"
git config --local gc.auto 0
git fetch --depth=1 --no-tags --prune origin refs/tags/$TAG
git checkout FETCH_HEAD
- name: Install prerequisites
run: |
apt update
apt install -y ruby python3-setuptools
gem install fpm
- name: Build package
env:
PYTHONDONTWRITEBYTECODE: '1'
run: |
fpm -s python \
--verbose \
--python-bin python3 \
--python-pip pip3 \
--python-package-name-prefix python3 \
--name $PKGNAME \
--maintainer 'compAIR development team <kontakt@comp-air.at>' \
--vendor compAIR \
--iteration $EXTRA_VER \
--deb-priority optional \
--architecture all \
--output-type deb \
setup.py
- name: Print packages contents
run: |
for f in *.deb; do
echo "$f:"
dpkg-deb -c "$f"
echo
done
- name: Print packages control info
run: |
for f in *.deb; do
echo "$f:"
dpkg-deb -e "$f"
cat DEBIAN/control
echo
done
# https://forgejo.org/docs/latest/user/packages/debian/#publish-a-package
- name: push deb to apt repository
if: github.ref == 'refs/heads/master'
env:
REPO: ${{ github.repository }}
TAG: ${{ steps.tag.outputs.tag }}
run: |
url="$GITHUB_SERVER_URL/api/packages/${{ github.repository_owner }}/debian/pool/bookworm/compair/upload"
echo "api url: $url"
debver="${UPSTREAM_VER}-${EXTRA_VER}"
debfile="${PKGNAME}_${debver}_all.deb"
echo "uploading file: $debfile"
curl --fail-with-body \
-X PUT \
--user "oauth2:${{ secrets.PACKAGE_REGISTRY_TOKEN }}" \
--upload-file "$debfile" \
"$url"
echo "final url: $GITHUB_SERVER_URL/${{ github.repository_owner }}/-/packages/debian/${PKGNAME}/${debver}"