Package Application #4
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: | |
matrix: | |
architecture: [ 'x64', 'x86' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
architecture: ${{ matrix.architecture }} | |
cache: 'pip' | |
cache-dependency-path: 'poetry.lock' | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install . | |
- 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: 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 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
architecture: 'x64' | |
cache: 'pip' | |
cache-dependency-path: 'poetry.lock' | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install . | |
- name: Package | |
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 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
architecture: 'x64' | |
cache: 'pip' | |
cache-dependency-path: 'poetry.lock' | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install . | |
- name: Package | |
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/release-action@v1.13.0 | |
with: | |
allowUpdates: true | |
commit: 'master' | |
tag: ${{ github.event.inputs.version }} | |
name: ${{ github.event.inputs.version }} | |
artifacts: '*/*.zip' |