legendary/.github/workflows/python.yml

98 lines
2.1 KiB
YAML

name: Python
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
pyinstaller:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04', 'windows-latest', 'macos-11']
max-parallel: 3
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Python components
run: pip3 install --upgrade
setuptools
wheel
- name: Legendary dependencies and build tools
run: pip3 install --upgrade
pyinstaller
requests
- name: Optional dependencies (WebView)
run: pip3 install --upgrade pywebview
if: runner.os != 'macOS'
- name: Strip
id: strip
run: echo ::set-output name=option::--strip
if: runner.os != 'Windows'
- name: Build
working-directory: legendary
run: pyinstaller
--onefile
--name legendary
--target-architecture universal2
${{ steps.strip.outputs.option }}
cli.py
env:
PYTHONOPTIMIZE: 1
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-package
path: legendary/dist/*
deb:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-20.04']
fail-fast: true
max-parallel: 3
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: sudo apt install
python3-all
python3-stdeb
dh-python
python3-requests
python3-setuptools
python3-wheel
# pywebview is too outdated on 20.04, re-enable this on 22.04
# python3-webview
# python3-gi
# python3-gi-cairo
# gir1.2-gtk-3.0
- name: Build
run: python3 setup.py --command-packages=stdeb.command bdist_deb
- name: Os version
id: os_version
run: |
source /etc/os-release
echo ::set-output name=version::$NAME-$VERSION_ID
- uses: actions/upload-artifact@v2
with:
name: ${{ steps.os_version.outputs.version }}-deb-package
path: deb_dist/*.deb