Skip to content

Merge pull request #384 from CovenEsme/return-to-latest-python312 #88

Merge pull request #384 from CovenEsme/return-to-latest-python312

Merge pull request #384 from CovenEsme/return-to-latest-python312 #88

Workflow file for this run

name: Build
on:
push:
branches:
- main
workflow_dispatch:
inputs:
# we don't currently take in the input version, instead
# we read the version from the constants/randoconstants.py file
# version:
# description: Version
# type: string
env:
description: Environment
type: string
required: true
default: "Production"
workflow_call: # allows the workflow to be called from other workflows
inputs:
# version:
# description: Version
# type: string
env:
description: Environment
type: string
required: true
default: "Production"
jobs:
build:
strategy:
matrix:
include:
- name: Windows Build
os: windows-latest
architecture: x64
artifact: windows
artifact_suffix: ""
- name: MacOS Build x64
os: macos-13
architecture: x64
artifact: macos
artifact_suffix: _intel
- name: MacOS Build arm64
os: macos-14
architecture: arm64
artifact: macos
artifact_suffix: _apple_silicon
- name: Linux Build
os: ubuntu-latest
architecture: x64
artifact: linux
artifact_suffix: ""
runs-on: ${{ matrix.os }}
environment: ${{ github.event.inputs.env || 'Production' }}
defaults:
run:
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
MACOSX_DEPLOYMENT_TARGET: 13
steps:
- uses: actions/checkout@v4
# Setup Python
- name: Set up Python
id: setup-py
uses: actions/setup-python@v5
with:
# TODO: Unfreeze python version when this is resolved: https://github.com/actions/setup-python/issues/886
python-version: "3.12"
check-latest: true
architecture: ${{ matrix.architecture }}
cache: "pip" # Cache all pip dependency downloads
- name: Cache venv
id: cache-venv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ matrix.os }}-venv-${{ steps.setup-py.outputs.python-version }}-${{ hashFiles('**/req*.txt') }}
- name: Create venv
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv ./.venv
- name: Activate venv
run: |
source ./.venv/bin/activate || source ./.venv/Scripts/activate
echo $PATH >> $GITHUB_PATH
# Build and compile
- name: Install venv dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Install any missing Qt dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y qtbase5-dev
sudo apt-get install -y libxcb-cursor0
- name: Build Python App
run: python -m PyInstaller --log-level=WARN sshdrando.spec
- name: Bundle Python App
run: python build.py
- name: Read Version
uses: SebRollen/[email protected]
id: read_toml
with:
file: "constants/randoconstants.py"
field: "VERSION"
# Archive and upload artifacts
- name: Tar Files if not Windows Build
if: runner.os != 'Windows'
run: tar -C "dist/release_archive_${{ steps.read_toml.outputs.value }}_${{ matrix.artifact }}/" -cvf "Skyward Sword HD Randomizer v${{ steps.read_toml.outputs.value }} (${{ matrix.artifact }}${{ matrix.artifact_suffix }}).tar" .
- name: Upload non-Windows Artifact
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: Skyward Sword HD Randomizer v${{ steps.read_toml.outputs.value }} (${{ matrix.artifact }}${{ matrix.artifact_suffix }})
path: Skyward Sword HD Randomizer v${{ steps.read_toml.outputs.value }} (${{ matrix.artifact }}${{ matrix.artifact_suffix }}).tar
- name: Upload Windows Artifact
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: Skyward Sword HD Randomizer v${{ steps.read_toml.outputs.value }} (${{ matrix.artifact }})
path: dist/release_archive_${{ steps.read_toml.outputs.value }}_${{ matrix.artifact }}