Skip to content

Package Application

Package Application #1

Workflow file for this run

name: Package Application with cx_Freeze
on:
workflow_dispatch:
inputs:
version:
description: "Version (semantic)"
required: true
default: "X.X"
jobs:
build-windows:
runs-on: windows-latest
strategy:
matrix:
architecture: [ 'x64', 'x86' ]
steps:
- uses: actions/checkout@v3
- 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
(Get-Content pyproject.toml) -replace ', "whisper"', '' | Set-Content pyproject.toml
pip install .
pip install cx-Freeze
- name: Download ffmpeg
run: |
Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/6.0/ffmpeg-6.0-essentials_build.zip -O 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
- run: python setup.py build -b dist
- run: 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-windows-msi:
runs-on: windows-latest
strategy:
matrix:
architecture: [ 'x64', 'x86' ]
env:
LANG: C.UTF-8
LC_ALL: C.UTF-8
LC_CTYPE: C.UTF-8
PYTHONIOENCODING: UTF-8
steps:
- uses: actions/checkout@v3
- 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
(Get-Content pyproject.toml) -replace ', "whisper"', '' | Set-Content pyproject.toml
pip install .
pip install cx-Freeze
- name: Download ffmpeg
run: |
Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/6.0/ffmpeg-6.0-essentials_build.zip -O 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
- run: python setup.py build bdist_msi
# - run: mv 'dist/*.msi' AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}.msi
- uses: actions/upload-artifact@v3
with:
name: AlMufarrigh-${{ runner.os }}-${{ matrix.architecture }}.msi
path: 'dist/*.msi'
build-macos-dmg:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- 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
sed -i 's/, "whisper"//' pyproject.toml
pip install .
pip install cx-Freeze
- name: Run cx_Freeze
run: python setup.py bdist_dmg
- run: mv 'build/Install*.dmg' AlMufarrigh-macOS.dmg
- uses: actions/upload-artifact@v3
with:
name: AlMufarrigh-macOS.dmg
path: AlMufarrigh-macOS.dmg
build-macos-app:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- 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
sed -i 's/, "whisper"//' pyproject.toml
pip install .
pip install cx-Freeze
- name: Run cx_Freeze
run: python setup.py bdist_mac
- run: mv build/AlMufarrigh.app AlMufarrigh-macOS.app
- run: zip -r9 AlMufarrigh-macOS-app.zip AlMufarrigh-macOS.app/*
- 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@v3
- 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
sed -i 's/, "whisper"//' pyproject.toml
pip install .
pip install cx-Freeze
- name: Run cx_Freeze
run: |
python setup.py build
mv exe.linux-x86_64-3.10 AlMufarrigh-linux-x64
zip -r9 AlMufarrigh-linux-x64.zip AlMufarrigh-linux-x64/*
- 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-windows-msi, build-macos-dmg, build-macos-app, build-linux ]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Release
uses: ncipollo/release-action@v1.10.0
with:
allowUpdates: true
commit: 'master'
tag: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
artifacts: '*/*.msi, */*.zip, */*.dmg'