mirror of
https://github.com/ValdikSS/tor-relay-scanner.git
synced 2026-09-25 16:07:55 +03:00
88 lines
2.8 KiB
YAML
88 lines
2.8 KiB
YAML
name: Build tor-relay-scanner
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'src/**'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
PYTHON_URL: https://github.com/Alex313031/Python-Win7/raw/refs/heads/master/3.12.12/python-3.12.12-full.exe
|
|
PYTHON_NAME: python-3.12.12-full.exe
|
|
PYTHON_SHA256: f4276c2245d762042f9f5dc7b3099c7e9c5a9a8174e8ee49d49ca40c23cb63d5
|
|
WINEARCH: win32
|
|
|
|
jobs:
|
|
build_linux:
|
|
name: Build Python pyz file
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Declare short commit variable
|
|
id: vars
|
|
run: |
|
|
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build pyz file
|
|
run: |
|
|
./build.sh
|
|
mv torparse.pyz tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.pyz
|
|
|
|
- name: Upload output file x86
|
|
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_windows:
|
|
name: Build Windows exe file
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Declare short commit variable
|
|
id: vars
|
|
run: |
|
|
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Wine
|
|
run: >
|
|
sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf &&
|
|
sudo apt-add-repository -y ppa:ondrej/php &&
|
|
sudo eatmydata apt install ppa-purge &&
|
|
sudo eatmydata ppa-purge -y ppa:ondrej/php &&
|
|
sudo dpkg --add-architecture i386 && sudo apt update &&
|
|
sudo DEBIAN_FRONTEND=noninteractive eatmydata
|
|
apt install -y --no-install-recommends wine-stable wine32 xvfb
|
|
|
|
- name: Download Python from cache
|
|
id: python-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env. PYTHON_NAME }}
|
|
key: ${{ env. PYTHON_SHA256 }}
|
|
|
|
- name: Download Python from the website
|
|
if: steps.python-cache.outputs.cache-hit != 'true'
|
|
run: >
|
|
wget ${{ env. PYTHON_URL }} &&
|
|
(echo ${{ env. PYTHON_SHA256 }} ${{ env. PYTHON_NAME }} | sha256sum -c)
|
|
|
|
- name: Install Python and dependencies (Windows)
|
|
run: |
|
|
xvfb-run wine ${{ env. PYTHON_NAME }} /quiet InstallAllUsers=1 PrependPath=1
|
|
wine pip install .
|
|
wine pip install pyinstaller
|
|
|
|
- name: Build exe file for Windows
|
|
run: |
|
|
wine pyinstaller -c -F src/tor_relay_scanner/__main__.py
|
|
mv dist/__main__.exe tor-relay-scanner-${{ steps.vars.outputs.sha_short }}.exe
|
|
|
|
- name: Upload output file
|
|
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
|