mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-05-26 07:08:04 +00:00
docker ci only
This commit is contained in:
213
.github/workflows/ci.yml
vendored
213
.github/workflows/ci.yml
vendored
@@ -40,215 +40,6 @@ jobs:
|
||||
echo -e "\nFailed to validate the following language file(s): ${failed[@]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
windows:
|
||||
name: Windows
|
||||
runs-on: windows-latest
|
||||
needs:
|
||||
- validate
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up variables
|
||||
id: vars
|
||||
run: |
|
||||
Add-Content $env:GITHUB_OUTPUT "sha_short=$(git rev-parse --short HEAD)"
|
||||
|
||||
- name: Append git revision to project version
|
||||
run: |
|
||||
(Get-Content src/version.py) `
|
||||
-Replace '^__version__\s*=\s*"[^"]+', "`$0.${{steps.vars.outputs.sha_short}}" |`
|
||||
Out-File src/version.py
|
||||
|
||||
# Ensure Python version
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{env.PYTHON_VERSION}}
|
||||
|
||||
- name: Install project dependencies
|
||||
run: |
|
||||
python3 -m pip install wheel
|
||||
python3 -m pip install -r requirements.txt
|
||||
|
||||
# TODO: Consider using https://github.com/crazy-max/ghaction-upx
|
||||
# or some other way of keeping the download link up to date in the future
|
||||
- name: Install UPX
|
||||
if: env.USE_UPX == 'true'
|
||||
run: |
|
||||
Invoke-WebRequest -Uri https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-win64.zip -OutFile (Join-Path $env:Temp upx.zip)
|
||||
Expand-Archive -LiteralPath (Join-Path $env:Temp upx.zip) -DestinationPath $env:Temp
|
||||
Move-Item -Path (Join-Path $env:Temp upx-*) -Destination (Join-Path $env:Temp upx)
|
||||
Add-Content $env:GITHUB_PATH (Join-Path $env:Temp upx)
|
||||
|
||||
- name: Install PyInstaller
|
||||
run: |
|
||||
python3 -m pip install pyinstaller
|
||||
|
||||
- name: Create portable executable
|
||||
run: |
|
||||
pyinstaller build.spec
|
||||
|
||||
- name: Create release folder
|
||||
run: |
|
||||
$FolderName = 'Twitch Drops Miner'
|
||||
New-Item $FolderName -ItemType Directory
|
||||
Copy-Item dist\*.exe $FolderName
|
||||
Copy-Item manual.txt $FolderName
|
||||
Compress-Archive -Path $FolderName -DestinationPath Twitch.Drops.Miner.Windows.zip
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: Twitch.Drops.Miner.Windows
|
||||
path: Twitch.Drops.Miner.Windows.zip
|
||||
|
||||
linux-pyinstaller:
|
||||
name: Linux (PyInstaller) (${{matrix.arch}})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86_64
|
||||
runner: ubuntu-22.04
|
||||
- arch: aarch64
|
||||
runner: ubuntu-22.04-arm
|
||||
runs-on: ${{matrix.runner}}
|
||||
needs:
|
||||
- validate
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up variables
|
||||
id: vars
|
||||
run: |
|
||||
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Append git revision to project version
|
||||
run: |
|
||||
sed -ri "s/^__version__\s*=\s*\"[^\"]+/\0.${{steps.vars.outputs.sha_short}}/" src/version.py
|
||||
|
||||
# Ensure Python version
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{env.PYTHON_VERSION}}
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libgirepository1.0-dev gir1.2-ayatanaappindicator3-0.1 libayatana-appindicator3-1 python3-tk
|
||||
|
||||
- name: Install project dependencies
|
||||
run: |
|
||||
python3 -m pip install wheel
|
||||
python3 -m pip install -r requirements.txt
|
||||
|
||||
- name: Install PyInstaller
|
||||
run: |
|
||||
python3 -m pip install pyinstaller
|
||||
|
||||
# NOTE: Remove this step if/once libxft gets updated to 2.3.5 or newer on Ubuntu 22.04, which currently has 2.3.4.
|
||||
- name: Build a recent version of libXft
|
||||
run: |
|
||||
mkdir -p /tmp/libXft
|
||||
cd /tmp/libXft
|
||||
curl -fL https://xorg.freedesktop.org/releases/individual/lib/libXft-2.3.9.tar.xz -o libXft.tar.xz
|
||||
sha256sum libXft.tar.xz
|
||||
tar xvf libXft.tar.xz
|
||||
cd libXft-*
|
||||
./configure --prefix=/tmp/libXft --sysconfdir=/etc --disable-static
|
||||
make
|
||||
make install-strip
|
||||
|
||||
- name: Create portable executable
|
||||
run: |
|
||||
LD_LIBRARY_PATH=/tmp/libXft/lib xvfb-run --auto-servernum pyinstaller build.spec
|
||||
|
||||
- name: Show PyInstaller warnings
|
||||
run: |
|
||||
cat build/build/warn-build.txt || true
|
||||
|
||||
- name: Create release folder
|
||||
run: |
|
||||
folder='Twitch Drops Miner'
|
||||
mkdir "${folder}"
|
||||
cp manual.txt dist/* "${folder}"
|
||||
7z a 'Twitch.Drops.Miner.Linux.PyInstaller-${{matrix.arch}}.zip' "${folder}"
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: Twitch.Drops.Miner.Linux.PyInstaller-${{matrix.arch}}
|
||||
path: Twitch.Drops.Miner.Linux.PyInstaller-${{matrix.arch}}.zip
|
||||
|
||||
linux-appimage:
|
||||
name: Linux (AppImage) (${{matrix.arch}})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- arch: x86_64
|
||||
runner: ubuntu-22.04
|
||||
- arch: aarch64
|
||||
runner: ubuntu-22.04-arm
|
||||
runs-on: ${{matrix.runner}}
|
||||
needs:
|
||||
- validate
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up variables
|
||||
id: vars
|
||||
run: |
|
||||
echo "app_version=$(python3 -c 'import sys; sys.path.insert(0, "src"); from version import __version__ as v; print(v)')" >> "${GITHUB_OUTPUT}"
|
||||
echo "sha_short=$(git rev-parse --short HEAD)" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Append git revision to project version
|
||||
run: |
|
||||
sed -ri "s/^__version__\s*=\s*\"[^\"]+/\0.${{steps.vars.outputs.sha_short}}/" src/version.py
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libgirepository1.0-dev gir1.2-ayatanaappindicator3-0.1 libayatana-appindicator3-1
|
||||
|
||||
- name: Install appimage-builder
|
||||
run: |
|
||||
# TODO: Switch to a stable release if/when a version newer than 1.1.0 is released.
|
||||
python3 -m pip install git+https://github.com/AppImageCrafters/appimage-builder.git@e995e8edcc227d14524cf39f9824c238f9435a22
|
||||
|
||||
- name: Create AppImage
|
||||
env:
|
||||
ARCH: ${{matrix.arch}}
|
||||
ARCH_APT: ${{matrix.arch == 'x86_64' && 'amd64' || 'arm64'}}
|
||||
APP_VERSION: ${{steps.vars.outputs.app_version}}.${{steps.vars.outputs.sha_short}}
|
||||
PYTHON_VERSION: ${{env.PYTHON_VERSION}}
|
||||
run: |
|
||||
appimage-builder --recipe appimage/AppImageBuilder.yml
|
||||
|
||||
- name: Create release folder
|
||||
run: |
|
||||
folder='Twitch Drops Miner'
|
||||
mkdir "${folder}"
|
||||
cp *.AppImage manual.txt "${folder}"
|
||||
7z a 'Twitch.Drops.Miner.Linux.AppImage-${{matrix.arch}}.zip' "${folder}"
|
||||
|
||||
- name: Upload build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
if-no-files-found: error
|
||||
name: Twitch.Drops.Miner.Linux.AppImage-${{matrix.arch}}
|
||||
path: Twitch.Drops.Miner.Linux.AppImage-${{matrix.arch}}.zip
|
||||
|
||||
docker:
|
||||
name: Docker Build
|
||||
runs-on: ubuntu-latest
|
||||
@@ -309,9 +100,7 @@ jobs:
|
||||
name: Upload builds to Releases
|
||||
if: github.event_name != 'pull_request'
|
||||
needs:
|
||||
- windows
|
||||
- linux-pyinstaller
|
||||
- linux-appimage
|
||||
- docker
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
Reference in New Issue
Block a user