Skip to content

Build Postcompiler

Build Postcompiler #30

name: Build Postcompiler
on:
schedule:
- cron: '14 9 * * TUE' # Run at 9:14 (7:14pm local) on Tuesday
create:
ref_type: 'tag'
workflow_dispatch:
# Allow triggering manually whenever it's useful.
jobs:
freeze:
strategy:
fail-fast: false
matrix:
include:
# We want 3.8 because it works on Windows 7.
- artifact-name: 'win32'
python-version: '3.8.10'
arch: 'x86'
os: 'windows-latest'
- artifact-name: 'win64'
python-version: '3.11'
arch: 'x64'
os: 'windows-latest'
- artifact-name: 'linux64'
python-version: '3.11'
arch: 'x64'
os: 'ubuntu-latest'
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}-${{ matrix.arch }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.arch }}
cache: 'pip'
cache-dependency-path: 'requirements.txt'
- name: Install srctools
run: |
python -m pip install -U setuptools pip wheel
python -m pip install -r requirements.txt
- name: Freeze application
run: python -m PyInstaller --distpath ../build/ -y ../postcompiler.spec
working-directory: ./src/
- name: Artifact upload (tag)
uses: actions/upload-artifact@v3
if: github.event_name == 'create'
with:
name: hammeraddons_${{ github.event.ref }}_${{ matrix.artifact-name }}
path: ./build/
if-no-files-found: error
- name: Artifact upload (hash)
uses: actions/upload-artifact@v3
if: github.event_name != 'create'
with:
name: hammeraddons_${{ github.sha }}_${{ matrix.artifact-name }}
path: ./build/
if-no-files-found: error