Package Application #37
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: Package Application | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version (semantic)" | |
required: true | |
default: "X.X" | |
spec: | |
description: "Spec file" | |
required: true | |
default: "almufarrigh.spec" | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ 'windows-latest', 'macos-latest' ] | |
python-version: [ "3.12" ] | |
poetry-version: [ "1.8.4" ] | |
variant: [ 'wit', 'whisper' ] | |
architecture: [ 'x64' ] | |
# include: | |
# - os: windows-latest | |
# architecture: 'x86' | |
# python-version: "3.9" | |
# poetry-version: "1.8.4" | |
# variant: "wit" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Caching | |
uses: actions/cache@v4 | |
with: | |
path: ./.venv | |
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }} | |
- name: Install requirements | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- run: poetry install --with ${{ matrix.variant }} --with dev | |
- name: Download ffmpeg (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/6.0/ffmpeg-6.0-essentials_build.zip -OutFile ffmpeg.zip | |
tar.exe -xf ffmpeg.zip | |
move ffmpeg-6.0-essentials_build/bin/ffmpeg.exe ffmpeg.exe | |
move ffmpeg-6.0-essentials_build/bin/ffprobe.exe ffprobe.exe | |
- name: Download FFmpeg and FFprobe (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
wget https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-6.0-amd64-static.tar.xz | |
tar xvf ffmpeg-6.0-amd64-static.tar.xz | |
mv ffmpeg-6.0-amd64-static/ffmpeg . | |
mv ffmpeg-6.0-amd64-static/ffprobe . | |
chmod +x ffmpeg ffprobe | |
- name: Download FFmpeg and FFprobe (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
curl -L https://evermeet.cx/pub/ffmpeg/ffmpeg-6.0.zip -o ffmpeg.zip | |
curl -L https://evermeet.cx/pub/ffprobe/ffprobe-6.0.zip -o ffprobe.zip | |
unzip ffmpeg.zip | |
unzip ffprobe.zip | |
chmod +x ffmpeg ffprobe | |
- name: Package | |
run: | | |
poetry run pyside6-rcc src/resources.qrc -o src/resources_rc.py | |
poetry run pyinstaller ${{ github.event.inputs.spec }} | |
- name: Compress (Windows) | |
if: runner.os == 'Windows' | |
run: tar.exe -acf AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}-${{ matrix.variant }}-portable.zip dist | |
- name: Compress | |
if: runner.os != 'Windows' | |
run: zip -r9 AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}-${{ matrix.variant }}.zip dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}-${{ matrix.variant }} | |
path: AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}-${{ matrix.variant }}* | |
release: | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Release | |
uses: ncipollo/release-action@v1.14.0 | |
with: | |
allowUpdates: true | |
commit: 'main' | |
tag: ${{ github.event.inputs.version }} | |
name: ${{ github.event.inputs.version }} | |
artifacts: '*/*.zip' |