Update publish-app.yml #15
Workflow file for this run
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: Publish App | |
on: | |
push: | |
tags: | |
- "v*.*.*-app" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
id: setup_python | |
with: | |
python-version: "3.12" | |
- name: Restore cached venv | |
uses: actions/cache/restore@v4 | |
with: | |
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-ci-app.txt', 'requirements.txt') }} | |
path: .venv | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate || source .venv/scripts/activate | |
python -m pip install -r requirements-ci-app.txt | |
echo "$VIRTUAL_ENV/bin" >> $GITHUB_PATH | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
- name: Saved cached venv | |
uses: actions/cache/save@v4 | |
with: | |
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-ci-app.txt', 'requirements.txt') }} | |
path: .venv | |
- name: Build | |
run: | | |
source .venv/bin/activate || source .venv/scripts/activate | |
cd src | |
pyinstaller --noconsole --name byzantine-chant-ocr app.py | |
- name: Archive | |
shell: pwsh | |
run: | | |
cd src/dist | |
if ($env:RUNNER_OS -eq "Windows") { | |
7z a byzantine-chant-ocr-${{github.ref_name}}-${{ runner.os }}.zip byzantine-chant-ocr | |
} | |
elseif ($env:RUNNER_OS -eq "macOS") { | |
zip -r byzantine-chant-ocr-${{github.ref_name}}-${{ runner.os }}.zip byzantine-chant-ocr.app | |
} | |
else { | |
zip -r byzantine-chant-ocr-${{github.ref_name}}-${{ runner.os }}.zip byzantine-chant-ocr | |
} | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: src/dist/byzantine-chant-ocr-${{github.ref_name}}-${{ runner.os }}.zip | |
draft: true |