102 lines
2.6 KiB
YAML
102 lines
2.6 KiB
YAML
name: pylogbeat
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- .github/workflows/pylogbeat.yaml
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/pylogbeat.yaml
|
|
|
|
jobs:
|
|
build-deb:
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- runner-group: dind
|
|
dpkg: all
|
|
fpm: all
|
|
|
|
runs-on:
|
|
group: ${{ matrix.platform.runner-group }}
|
|
|
|
container:
|
|
image: node:22-bookworm
|
|
|
|
steps:
|
|
- name: Checkout python-logstash-async
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: eht16/pylogbeat
|
|
ref: 2.0.1
|
|
|
|
- name: Fix git safe.directory
|
|
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
|
|
|
- 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 python3-pylogbeat \
|
|
--maintainer 'compAIR development team <kontakt@comp-air.at>' \
|
|
--vendor compAIR \
|
|
--iteration compair1 \
|
|
--deb-priority optional \
|
|
--architecture ${{ matrix.platform.fpm }} \
|
|
--output-type deb \
|
|
setup.py
|
|
|
|
- name: Copy over deb files to target directory
|
|
run: |
|
|
mkdir -p _packages
|
|
cp -v *.deb _packages/
|
|
|
|
- name: Print packages contents
|
|
run: |
|
|
for f in _packages/*.deb; do
|
|
echo "$f:"
|
|
dpkg-deb -c "$f"
|
|
echo
|
|
done
|
|
|
|
- name: Print packages control info
|
|
run: |
|
|
for f in _packages/*.deb; do
|
|
echo "$f:"
|
|
dpkg-deb -e "$f"
|
|
cat DEBIAN/control
|
|
echo
|
|
done
|
|
|
|
- name: Upload deb as artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: python3-pylogbeat_${{ matrix.platform.dpkg }}
|
|
path: _packages/*
|
|
if-no-files-found: error
|
|
overwrite: true
|
|
|
|
- name: Push deb to compREP
|
|
uses: cpina/github-action-push-to-another-repository@main
|
|
if: github.ref == 'refs/heads/master'
|
|
env:
|
|
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
|
|
with:
|
|
source-directory: "_packages/"
|
|
target-directory: "debs/complib/"
|
|
destination-github-username: "F-WuTS"
|
|
destination-repository-name: "compREP"
|
|
target-branch: master
|