Skip to content

.github/workflows/build_binaries.yml #45

.github/workflows/build_binaries.yml

.github/workflows/build_binaries.yml #45

on:
push:
tags:
- "*.*.*"
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install poetry
run: |
which python
python -m pip install pipx
python -m pipx install poetry
which poetry
python --version
- name: Restore cached virtualenv
uses: actions/cache/restore@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}--${{ hashFiles('poetry.lock') }}
path: .venv
- name: Install Dependencies
run: |
poetry install --with dev
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV
- name: Activate venv on Windows
if: matrix.os == 'windows-latest'
run: |
echo ".venv\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Activate venv on Linux/macOS
if: matrix.os != 'windows-latest'
run: echo ".venv/bin" >> $GITHUB_PATH
- name: Saved cached virtualenv
uses: actions/cache/save@v4
with:
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}--${{ hashFiles('poetry.lock') }}
path: .venv
- name: Install system build deps (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y python3-dev patchelf gcc
- name: show py
run: |
which python
which poetry
echo $PATH
python --version
- name: Build (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
./scripts/build-windows.ps1
- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
bash ./scripts/build-linux.sh
- name: Build (macOS)
if: matrix.os == 'macos-latest'
shell: bash
run: |
bash ./scripts/build-macos.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }} Build
path: |
build/DerpiWallpaper.exe
build/DerpiWallpaper.bin
build/DerpiWallpaper
include-hidden-files: true