Вот мой Github Action

```yml
name: Build tor-relay-scanner
on:
  push:
    paths:
      - 'src/**'
  workflow_dispatch:
jobs:
  build-pyz:
    name: Build Python pyz file
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.8'
      - name: Get short SHA
        id: vars
        shell: bash
        run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
      - name: Install dependencies
        run: |
          pip install .
      - name: Build pyz file
        shell: bash
        run: |
          ./build.sh
          mv torparse.pyz tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.pyz
      - name: Upload pyz artifact
        uses: actions/upload-artifact@v4
        with:
          name: tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.pyz
          path: tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.pyz
  build-exe:
    name: Build Windows exe file
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.8'
      - name: Get short SHA
        id: vars
        shell: bash
        run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
      - name: Install dependencies
        run: |
          pip install .
          pip install pyinstaller
      - name: Build exe file
        run: |
          pyinstaller -c -F src\tor_relay_scanner\__main__.py
          move dist\__main__.exe tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.exe
      - name: Upload exe artifact
        uses: actions/upload-artifact@v4
        with:
          name: tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.exe
          path: tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.exe

```


Это мой setup.cfg

```

[metadata]
name = tor_relay_scanner
version = 1.0.0
author = ValdikSS
author_email = <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>
description = Tor Relay availability checker, for using it as a bridge in countries with censorship
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/ValdikSS/tor-relay-scanner
project_urls =
    Bug Tracker = https://github.com/ValdikSS/tor-relay-scanner/issues
classifiers =
    Programming Language :: Python :: 3
    Operating System :: OS Independent

[options]
package_dir = 
            =src
packages = find:
python_requires = >=3.7
#install_requires = requests[socks]
install_requires = 
    requests[socks]@https://github.com/psf/requests/archive/8c86fb111b955ea76439199821973c40a70a19a2.zip ;platform_system=='Windows'
    requests[socks] ;platform_system!='Windows'

[options.packages.find]
where = src

```


Можно попробовать собирать в Docker-контейнере (чтобы не тратить время на удаление ненужных пакетов и установку дополнительных), а контейнер кешировать, как здесь.

```yml

name: Build zapret
on:
  push:
    paths:
      - 'ip2net/**'
      - 'mdig/**'
      - 'nfq/**'
      - 'tpws/**'
  pull_request:
    paths:
      - 'ip2net/**'
      - 'mdig/**'
      - 'nfq/**'
      - 'tpws/**'
  workflow_dispatch:

env:
  DOCKER_BUILD_SUMMARY: false

jobs:
  build:
    name: Build for Linux
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        arch:
          - aarch64-musl
          - arm-musleabi
          - arm-musleabihf
          - mipsel-musl
          - i586-musl
          - x86_64-musl
    # container:
    #   image: messense/rust-musl-cross:${{ matrix.arch }}
    #   options: --user root
    steps:
      - uses: actions/checkout@v4

      - name: Docker in tmpfs
        run: |
          sudo systemctl stop docker
          sudo mount -t tmpfs -o size=80% tmpfs /var/lib/docker
          sudo systemctl start docker
      - name: Cache Docker images
        id: docker-cache
        uses: ScribeMD/docker-cache@0.5.0
        with:
          key: docker-${{ runner.os }}-${{ matrix.arch }}

      # - name: Set up Docker Buildx
      #   if: steps.docker-cache.outputs.cache-hit != 'true'
      #   uses: docker/setup-buildx-action@v3

      - name: Build Docker image
        if: steps.docker-cache.outputs.cache-hit != 'true'
        uses: docker/build-push-action@v6
        with:
          tags: zapret-musl-cross:${{ matrix.arch }}
          context: .
          load: true
          build-args: BUILDARCH=${{ matrix.arch }}
          # cache-from: type=gha
          # cache-to: type=gha,mode=max

      - name: Compile zapret
        run: |
          docker run --entrypoint=bash -v ${{ github.workspace }}:/work \
          zapret-musl-cross:${{ matrix.arch }} \
          -c 'cd /work; CC=$TARGET_CC CFLAGS="-static" make -j$(nproc)'
      - name: Declare short commit variable
        id: vars
        run: |
          git config --global --add safe.directory '*' && echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
      - name: Upload output file
        uses: actions/upload-artifact@v4
        with:
          name: zapret_${{ steps.vars.outputs.sha_short }}_${{ matrix.arch }}
          path: binaries/my/

```

```Dockerfile
ARG BUILDARCH=x86_64-musl

FROM messense/rust-musl-cross:$BUILDARCH

RUN <<'EOF'
    set -eu
    export PKG_CONFIG_PATH=$TARGET_HOME/lib/pkgconfig/
    export CC=$TARGET_CC

    mkdir /root/extlibs
    cd /root/extlibs

    apt update
    apt install --no-install-recommends -y wget libtool pkg-config libcap-dev

    wget https://www.zlib.net/zlib-1.3.1.tar.gz
    echo 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 zlib-1.3.1.tar.gz | sha256sum -c && tar axf zlib-1.3.1.tar.gz

    git clone -b libnfnetlink-1.0.2 --depth 1 git://git.netfilter.org/libnfnetlink
    git clone -b libnetfilter_queue-1.0.5 --depth 1 git://git.netfilter.org/libnetfilter_queue
    git clone -b libmnl-1.0.5 --depth 1 git://git.netfilter.org/libmnl

    (
        cd zlib-*
        ./configure --static
        make -j$(nproc)
        make install
    )

    for i in libnfnetlink libmnl libnetfilter_queue; do
        (
            echo COMPILING $i
            cd $i
            ./autogen.sh
            ./configure --host=${TARGET_CC%-gcc} --prefix=$TARGET_HOME --enable-static
            make -j$(nproc)
            make install
        )
    done

    cp /usr/include/sys/capability.h ${TARGET_HOME}/include/sys/
    cp /usr/include/x86_64-linux-gnu/sys/queue.h ${TARGET_HOME}/include/sys/
EOF
```