fix: attach binaries in release #30
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: Python application | ||
on: | ||
pull_request: | ||
branches: ["main"] | ||
permissions: | ||
contents: write | ||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macOS-latest] | ||
python-version: ["3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- 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.__main__ import main\nmain()\n')" | ||
pyinstaller -F smassh.py --add-data="smassh/assets/languages/:smassh/assets/languages" --add-data="smassh/ui/css/:smassh/ui/css" | ||
- name: Upload a Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: termtyper-${{ matrix.os }} | ||
path: ./dist/smassh | ||
- name: Rename final file | ||
run: cp ./dist/dooit.exe ./dist/${{ matrix.os }}-dooit.exe | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ./dist/${{ matrix.os }}-dooit.exe |