Freeze Application #141
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Freeze Application | |
on: | |
schedule: | |
- cron: '47 9 * * THU' # Run at 9:47 (7:47pm local) on Thursday | |
create: | |
ref_type: 'tag' | |
workflow_dispatch: | |
# Allow triggering manually whenever it's useful. | |
inputs: | |
source: | |
description: 'Branch/Tag' | |
required: true | |
default: 'dev' | |
type: string | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
freeze: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# - artifact-name: 'win32' | |
# python-version: '3.8.10' | |
# arch: 'x86' | |
# os: 'windows-latest' | |
# bitness: '32' | |
# ffmpeg-repo: 'sudo-nautilus/FFmpeg-Builds-Win32' | |
- artifact-name: 'win64' | |
python-version: '3.12' | |
arch: 'x64' | |
os: 'windows-latest' | |
bitness: '64' | |
ffmpeg-repo: 'BtbN/FFmpeg-Builds' | |
- artifact-name: 'linux64' | |
python-version: '3.12' | |
arch: 'x64' | |
os: 'ubuntu-latest' | |
bitness: '64' | |
ffmpeg-repo: '' | |
runs-on: ${{ matrix.os }} | |
steps: | |
# Use the tag if created there, dev each week, or what's specified when done manually. | |
- name: Checkout tag | |
if: github.event_name == 'create' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Checkout dev | |
if: github.event_name == 'schedule' | |
uses: actions/checkout@v4 | |
with: | |
ref: 'dev' | |
fetch-depth: 0 | |
submodules: true | |
- name: Checkout reference | |
if: github.event_name == 'workflow_dispatch' | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.source }} | |
fetch-depth: 0 | |
submodules: true | |
- name: Set up Python ${{ matrix.python-version }}-${{ matrix.arch }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.arch }} | |
cache: 'pip' | |
cache-dependency-path: 'requirements.txt' | |
- name: Install dependencies | |
run: | | |
python -m pip install -U setuptools pip wheel | |
python -m pip install -r requirements.txt | |
- name: Download FFmpeg | |
if: ${{ matrix.ffmpeg-repo }} | |
uses: robinraju/[email protected] | |
with: | |
repository: ${{ matrix.ffmpeg-repo }} | |
latest: true | |
fileName: "ffmpeg-master-latest-win${{ matrix.bitness }}-lgpl-shared.zip" | |
out-file-path: "libs" | |
- name: Freeze compiler | |
run: python -m PyInstaller --distpath "../dist/${{ matrix.bitness }}bit/" -y compiler.spec | |
working-directory: ./src/ | |
- name: Freeze application | |
run: python -m PyInstaller --distpath "../dist/${{ matrix.bitness }}bit/" -y BEE2.spec | |
working-directory: ./src/ | |
- name: Compress Artifact | |
run: python -m zipfile --create "../../bee2_${{ matrix.bitness }}.zip" . | |
working-directory: ./dist/${{ matrix.bitness }}bit/BEE2/ | |
- name: Artifact upload (tag) | |
uses: actions/upload-artifact@v4 | |
if: github.event_name == 'create' | |
with: | |
name: beemod2_${{ github.event.ref }}_${{ matrix.artifact-name }} | |
path: ./dist/bee2_${{ matrix.bitness }}.zip | |
if-no-files-found: error | |
- name: Artifact upload (hash) | |
uses: actions/upload-artifact@v4 | |
if: github.event_name != 'create' | |
with: | |
name: beemod2_${{ github.sha }}_${{ matrix.artifact-name }} | |
path: ./dist/bee2_${{ matrix.bitness }}.zip | |
if-no-files-found: error |