Skip to content

Python application

Python application #36

Workflow file for this run

name: Python application
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pyinstaller
- name: Package app with pyinstaller
run: |
python -c "with open('smassh.py', 'w') as f: f.write('from smassh.__init__ import main\nmain()\n')"
pyinstaller -F smassh.py --add-data="smassh/ui/css/:smassh/ui/css"
- name: Set Binary file name
run: echo "BINARY_FILE_NAME=smassh${{ matrix.os == 'windows-latest' && '.exe' || '' }}" >> $GITHUB_ENV
- name: Set final file name
run: echo "FINAL_FILE_NAME=$(echo ${{ matrix.os }} | sed 's/-latest//;s/ubuntu/linux')-smassh${{ matrix.os == 'windows-latest' && '.exe' || '' }}" >> $GITHUB_ENV
- name: Rename final file
run: cp ./dist/${{ env.BINARY_FILE_NAME }} ./dist/${{ env.FINAL_FILE_NAME }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./dist/${{ env.FINAL_FILE_NAME }}