Build pywho #58
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 pywho | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'pywho.py' | |
workflow_dispatch: | |
env: | |
GIT_USER_NAME: github-actions[bot] | |
GIT_USER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | |
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 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- 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 | |
./build.sh && mkdir ./build-ubuntu && mv -f *.tar.gz *.sha512sum ./build-ubuntu | |
# git config --global user.name "${{ env.GIT_USER_NAME }}" | |
# git config --global user.email "${{ env.GIT_USER_EMAIL }}" | |
# git pull && git add bin && git commit -m "update ubuntu binary" && git push | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build-ubuntu-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 | |
fail-fast: false | |
container: python:${{ matrix.python-version }}-${{ matrix.debian-release }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run apt, venv, pip, build and upload artifacts | |
run: | | |
DEBIAN_FRONTEND=noninteractive apt-get update -y | |
apt-get install -y upx-ucl || { | |
apt-get install -y libucl1 && | |
wget -q http://ftp.us.debian.org/debian/pool/main/u/upx-ucl/upx-ucl_3.96-3+b1_amd64.deb && | |
dpkg -i upx-ucl_3.96-3+b1_amd64.deb; | |
} | |
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-debian && mv -f *.tar.gz *.sha512sum ./build-debian | |
# git config --global user.name "${{ env.GIT_USER_NAME }}" | |
# git config --global user.email "${{ env.GIT_USER_EMAIL }}" | |
# git pull && git add bin && git commit -m "update debian binaries" && git push | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build-debian-artifacts | |
path: ./build-debian/* | |
if-no-files-found: error | |
# centos7-container-build-job: | |
# 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@v3 | |
# - name: Run yum, venv, pip, build and upload artifacts | |
# run: | | |
# yum install -y gcc python3-devel python3-pip python3-virtualenv | |
# yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/u/ucl-1.03-24.el7.x86_64.rpm | |
# yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/u/upx-3.96-9.el7.x86_64.rpm | |
# 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-centos && mv -f *.tar.gz *.sha512sum ./build-centos | |
# # git config --global user.name "${{ env.GIT_USER_NAME }}" | |
# # git config --global user.email "${{ env.GIT_USER_EMAIL }}" | |
# # git pull && git add bin && git commit -m "update centos binary" && git push | |
# - uses: actions/upload-artifact@v2 | |
# with: | |
# name: build-centos-artifacts | |
# path: ./build-centos/* | |
# 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, centos7-container-build-job] | |
needs: [ubuntu-vm-build-job, debian-container-build-job] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: build-artifacts | |
- name: Create gh release using 'hub' | |
run: | | |
hub release create $(find -type f -printf '-a %p ') slv-pywho-v$(date +%Y%m%d) -F - <<'#####' | |
pywho | |
Pzs-ng's sitewho ported to Python, uses SHM and glftpd's 'ONLINE' C struct. | |
Download binaries for your specific OS | |
##### | |
working-directory: ./build-artifacts | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |