diff --git a/.github/workflows/pylogbeat.yaml b/.github/workflows/pylogbeat.yaml new file mode 100644 index 0000000..d9fb754 --- /dev/null +++ b/.github/workflows/pylogbeat.yaml @@ -0,0 +1,98 @@ +name: pylogbeat + +on: + push: + branches: + - master + pull_request: + +jobs: + build-deb: + strategy: + matrix: + platform: + - runner-group: Default + 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 ' \ + --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