Skip to content

Commit

Permalink
ci: add centos-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
silv3rr committed Jul 10, 2024
1 parent d040729 commit d5b03a2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
# 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
# ./build.sh && mkdir ./build-centos7 && mv -f *.tar.gz *.sha512sum ./build-centos7
# - uses: actions/upload-artifact@v3
# with:
# name: build-centos-artifacts
Expand All @@ -111,12 +111,17 @@ jobs:
strategy:
matrix:
include:
- rhel-distro: almalinux
- 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: rockylinux
- rhel-distro: rocky-linux
rhel-image: rockylinux
rhel-version: 9.3
fail-fast: false
container: ${{ matrix.rhel-distro }}:${{ matrix.rhel-version }}
container: ${{ matrix.rhel-image }}:${{ matrix.rhel-version }}
steps:
- uses: actions/checkout@v3
- name: Run yum, venv, pip, build and upload artifacts
Expand Down Expand Up @@ -189,3 +194,5 @@ jobs:
working-directory: ./build-artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ Now clone this repo and run build.sh, optionally add one or more of these args:

The build script will check and warn about wrong python version and missing modules.

## Build in docker

Same as github actions (CI), but locally:

`./docker-build-distro.sh ubuntu debian centos-stream alma rocky alpine`

## Issues

- If geoip2 is enabled you can run out of your free geoip queries
Expand Down
14 changes: 8 additions & 6 deletions docker-build-distros.sh → docker-build-distro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,22 @@ RHEL="
pip3 install --upgrade pip wheel setuptools
pip3 install -r requirements.txt
pip3 install pyinstaller sysv-ipc geoip2
./build.sh && mkdir ./build-alma && mv -f *.tar.gz *.sha512sum ./build-alma
./build.sh && mkdir ./build-$1 && mv -f *.tar.gz *.sha512sum ./build-$1
"

func_docker_run() {
image=$1
shift
docker run -it --rm --workdir /build -v $PWD:/build $image sh -c "$*"
docker run -it --rm --workdir /build -v "$PWD:/build" "$image" sh -c "$*"
}

case $1 in
ubuntu) func_docker_run ubuntu24.04 "$UBUNTU" ;;
debian) func_docker_run debian:12 "$DEBIAN" ;;
centos) func_docker_run centos:7 "$CENTOS" ;;
alpine) func_docker_run alpine:3.18 "$ALPINE" ;;
centos7) func_docker_run centos:7 "$CENTOS" ;;
centos-stream) func_docker_run quay.io/centos/centos:stream9 "$RHEL" ;;
alma) func_docker_run almalinux:9.4 "$RHEL" ;;
rocky) func_docker_run rockylinux:9.3 "$RHEL" ;;
esac
rocky) func_docker_run rockylinu:9.3 "$RHEL" ;;
alpine) func_docker_run alpine:3.18 "$ALPINE" ;;
*) echo "$0 $(grep -E ' *[a-z]+\).*;;' " $0" | cut -d')' -f1 | tr -d '\n')" ;;
esac
5 changes: 4 additions & 1 deletion spy.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,10 @@ def get_userfile(u_name) -> dict:
value = []
if line.startswith('CREDITS'):
value = 0
c = int((re.sub(r'^CREDITS [^0](\d+).*', r'\1', line)).strip())
try:
c = int((re.sub(r'^CREDITS [^0](\d+).*', r'\1', line)).strip())
except ValueError:
pass
if isinstance(c, int) and c > 0:
value = f"{round(int(c) / 1024**2)}GB"
else:
Expand Down

0 comments on commit d5b03a2

Please sign in to comment.