Build pyspy #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build pyspy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'spy.py' | ||
workflow_dispatch: | ||
env: | ||
GIT_USER_NAME: github-actions[bot] | ||
GIT_USER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | ||
BUILD_CENTOS7: false | ||
BUILD_WITH_BUNDLE: true | ||
jobs: | ||
ubuntu-vm-build-job: | ||
name: Build for Ubuntu | ||
runs-on: ubuntu-${{ matrix.ubuntu-version }} | ||
strategy: | ||
matrix: | ||
include: | ||
- ubuntu-release: focal_fossa | ||
ubuntu-version: 20.04 | ||
- ubuntu-release: jammy_jellyfish | ||
ubuntu-version: 22.04 | ||
- ubuntu-release: noble_numbat | ||
ubuntu-version: 24.04 | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run venv, pip, build and upload artifacts | ||
run: | | ||
python3 -m venv venv && . venv/bin/activate | ||
pip3 install --upgrade pip wheel setuptools | ||
pip3 install -r requirements.txt | ||
pip3 install pyinstaller sysv-ipc geoip2 flask | ||
./build.sh && mkdir ./build-ubuntu && mv -f *.tar.gz *.sha512sum ./build-ubuntu | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-ubuntu--${{ matrix.ubuntu-version }}-artifacts | ||
path: ./build-ubuntu/* | ||
if-no-files-found: error | ||
debian-container-build-job: | ||
name: Build for Debian | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- debian-release: buster | ||
debian-version: 10 | ||
python-version: 3.7 | ||
- debian-release: bullseye | ||
debian-version: 11 | ||
python-version: 3.9 | ||
- debian-release: bookworm | ||
debian-version: 12 | ||
python-version: 3.11 | ||
web: true | ||
fail-fast: false | ||
container: python:${{ matrix.python-version }}-${{ matrix.debian-release }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run apt, venv, pip, build and upload artifacts | ||
run: | | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get update -y | ||
python3 -m venv venv && . venv/bin/activate | ||
pip3 install --upgrade pip wheel setuptools | ||
pip3 install -r requirements.txt | ||
pip3 install pyinstaller sysv-ipc geoip2 flask | ||
./build.sh && mkdir ./build-debian && mv -f *.tar.gz *.sha512sum ./build-debian | ||
if [ "${{ env.BUILD_WITH_BUNDLE }}" == "true" }} ] && [ "${{ env.matrix.web }}" == "true" ]; then | ||
run: ./build.sh _WITH_BUNDLE && mkdir -p ./build-ubuntu && mv -f *.tar.gz *.sha512sum ./build-debian | ||
fi | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-debian-${{ matrix.debian-version }}-artifacts | ||
path: ./build-debian/* | ||
if-no-files-found: error | ||
centos7-container-build-job: | ||
if: env.BUILD_CENTOS7 | ||
Check failure on line 85 in .github/workflows/build.yml GitHub Actions / Build pyspyInvalid workflow file
|
||
name: Build for CentOS 7 | ||
runs-on: ubuntu-latest | ||
container: centos:7 | ||
steps: | ||
# get git-2.18 from softwarecollections, git-1.8 from base repo is too old for gh-actions | ||
- name: Install git-2.18 | ||
run: | | ||
yum install -y centos-release-scl && yum install -y rh-git218 | ||
cp -v -rf /opt/rh/httpd24/root/* /opt/rh/rh-git218/root/* / || true | ||
- uses: actions/checkout@v4 | ||
- name: Run yum, venv, pip, build and upload artifacts | ||
run: | | ||
yum install -y gcc python3-devel python3-pip python3-virtualenv | ||
python3 -m venv venv && . venv/bin/activate | ||
pip3 install --upgrade pip wheel setuptools | ||
pip3 install -r requirements.txt | ||
pip3 install pyinstaller sysv-ipc geoip2 | ||
./build.sh && mkdir ./build-centos7 && mv -f *.tar.gz *.sha512sum ./build-centos7 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-centos-artifacts | ||
path: ./build-centos/* | ||
if-no-files-found: error | ||
rhel-container-build-job: | ||
name: Build for RHEL | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- rhel-distro: centos-stream | ||
rhel-image: quay.io/centos/centos | ||
rhel-version: stream9 | ||
- rhel-distro: alma-linux | ||
rhel-image: almalinux | ||
rhel-version: 9.4 | ||
- rhel-distro: rocky-linux | ||
rhel-image: rockylinux | ||
rhel-version: 9.3 | ||
fail-fast: false | ||
container: ${{ matrix.rhel-image }}:${{ matrix.rhel-version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run yum, venv, pip, build and upload artifacts | ||
run: | | ||
dnf install -y gcc python3-devel python3-pip | ||
dnf install -y epel-release | ||
python3 -m venv venv && . venv/bin/activate | ||
pip3 install --upgrade pip wheel setuptools | ||
pip3 install -r requirements.txt | ||
pip3 install pyinstaller sysv-ipc geoip2 | ||
./build.sh && mkdir ./build-${{ matrix.rhel-distro }} && mv -f *.tar.gz *.sha512sum ./build-${{ matrix.rhel-distro }} | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-${{ matrix.rhel-distro }}-artifacts | ||
path: ./build-${{ matrix.rhel-distro }}/* | ||
if-no-files-found: error | ||
alpine-container-build-job: | ||
name: Build for Alpine Linux | ||
runs-on: ubuntu-latest | ||
container: alpine:latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run ap, venv, pip, build and upload artifacts | ||
run: | | ||
apk add python3 python3-dev py3-pip py3-virtualenv gcc musl-dev | ||
python3 -m venv venv && . venv/bin/activate | ||
pip3 install --upgrade pip wheel setuptools | ||
pip3 install -r requirements.txt | ||
pip3 install pyinstaller sysv-ipc geoip2 flask | ||
./build.sh && mkdir ./build-alpine && mv -f *.tar.gz *.sha512sum ./build-alpine | ||
if [ "${{ env.BUILD_WITH_BUNDLE }}" == "true" ]; then | ||
./build.sh _WITH_BUNDLE && mkdir -p ./build-alpine && mv -f *.tar.gz *.sha512sum ./build-alpine | ||
fi | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-alpine-artifacts | ||
path: ./build-alpine/* | ||
if-no-files-found: error | ||
create-release: | ||
name: Get artifacts, create release | ||
runs-on: ubuntu-latest | ||
needs: [ubuntu-vm-build-job, debian-container-build-job, rhel-container-build-job, alpine-container-build-job] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: build-artifacts | ||
# XXX: (replaced) hub release create slv-pyspy-v$(date +%Y%m%d) $(find -type f -printf '%p ') --notes-file - <<'#####' | ||
- name: Create release using 'gh' | ||
run: | | ||
Shows users logged into glftpd in terminal or as web page. Like 'gl_spy' and 'webspy' from foo-tools. | ||
Download binaries for your specific OS | ||
##### | ||
working-directory: ./build-artifacts | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||