Skip to content

Auto release from github actions #3

Auto release from github actions

Auto release from github actions #3

# docs at https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: PyInstaller Build
on:
workflow_dispatch:
push:
tags:
- v*
permissions:
contents: read
jobs:
build:
strategy:
max-parallel: 3
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
generic-name: Linux
executable-extension: ""
- os: macos-latest
generic-name: MacOS
executable-extension: ""
- os: windows-latest
generic-name: Windows
executable-extension: ".exe"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build with PyInstaller
run: |
pyinstaller --onefile main.py
mv dist/main${{ matrix.executable-extension }} dist/main-${{ matrix.generic-name }}${{ matrix.executable-extension }}
- name: Release
id: release
uses: softprops/action-gh-release@v2
with:
draft: true
make_latest: true
files: |
dist/main-${{ matrix.generic-name }}${{ matrix.executable-extension }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: executables-${{ matrix.generic-name }}
path: dist/*