Package Application #12
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-windows: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
architecture: [ 'x64', 'x86' ] | |
python-version: [ "3.10" ] | |
poetry-version: [ "1.6.1" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.architecture }} | |
- name: Install requirements | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- run: poetry install --with dev | |
- name: Caching | |
uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Download ffmpeg | |
run: | | |
Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/4.4/ffmpeg-4.4-essentials_build.zip -O ffmpeg.zip | |
tar.exe -xf ffmpeg.zip | |
move ffmpeg-4.4-essentials_build/bin/ffmpeg.exe ffmpeg.exe | |
move ffmpeg-4.4-essentials_build/bin/ffprobe.exe ffprobe.exe | |
- name: Package | |
run: poetry run pyinstaller ${{ github.event.inputs.spec }} && tar.exe -acf AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}-portable.zip dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}-portable | |
path: AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}-portable.zip | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.10" ] | |
poetry-version: [ "1.6.1" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: 'x64' | |
- name: Install requirements | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- run: poetry install --with dev | |
- name: Caching | |
uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Package | |
run: poetry run pyinstaller ${{ github.event.inputs.spec }} && zip -r9 AlMufarrigh-macOS-app.zip dist/* | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: AlMufarrigh-macOS-app.zip | |
path: AlMufarrigh-macOS-app.zip | |
build-linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.10" ] | |
poetry-version: [ "1.6.1" ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: 'x64' | |
- name: Install requirements | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- run: poetry install --with dev | |
- name: Caching | |
uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Package | |
run: poetry run pyinstaller ${{ github.event.inputs.spec }} && zip -r9 AlMufarrigh-linux-x64.zip dist/* | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: AlMufarrigh-linux-x64.zip | |
path: AlMufarrigh-linux-x64.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: [ build-windows, build-macos, build-linux ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Release | |
uses: ncipollo/[email protected] | |
with: | |
allowUpdates: true | |
commit: 'master' | |
tag: ${{ github.event.inputs.version }} | |
name: ${{ github.event.inputs.version }} | |
artifacts: '*/*.zip' |