2020-06-16 20:05:22 +00:00
|
|
|
name: Python
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ '*' ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ '*' ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
pyinstaller:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-01-26 16:18:02 +00:00
|
|
|
os: ['ubuntu-20.04', 'windows-2019', 'macos-11']
|
2021-10-29 15:37:18 +00:00
|
|
|
fail-fast: false
|
2020-06-16 20:05:22 +00:00
|
|
|
max-parallel: 3
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
2021-10-28 08:59:09 +00:00
|
|
|
python-version: '3.9'
|
2020-06-16 20:05:22 +00:00
|
|
|
|
2021-10-28 08:59:09 +00:00
|
|
|
- name: Python components
|
2020-06-16 20:05:22 +00:00
|
|
|
run: pip3 install --upgrade
|
|
|
|
setuptools
|
|
|
|
wheel
|
2021-10-28 08:59:09 +00:00
|
|
|
|
|
|
|
- name: Legendary dependencies and build tools
|
|
|
|
run: pip3 install --upgrade
|
|
|
|
pyinstaller
|
|
|
|
requests
|
2021-10-28 12:25:47 +00:00
|
|
|
|
|
|
|
- name: Optional dependencies (WebView)
|
|
|
|
run: pip3 install --upgrade pywebview
|
|
|
|
if: runner.os != 'macOS'
|
2020-06-16 20:05:22 +00:00
|
|
|
|
2021-10-31 13:13:14 +00:00
|
|
|
- name: Set strip option on non-Windows
|
2020-06-16 20:05:22 +00:00
|
|
|
id: strip
|
|
|
|
run: echo ::set-output name=option::--strip
|
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: legendary
|
|
|
|
run: pyinstaller
|
|
|
|
--onefile
|
|
|
|
--name legendary
|
|
|
|
${{ steps.strip.outputs.option }}
|
|
|
|
cli.py
|
2021-10-28 08:22:36 +00:00
|
|
|
env:
|
|
|
|
PYTHONOPTIMIZE: 1
|
2020-06-16 20:05:22 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ runner.os }}-package
|
|
|
|
path: legendary/dist/*
|
2020-09-08 15:21:07 +00:00
|
|
|
|
|
|
|
deb:
|
2022-09-16 11:17:47 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: ['ubuntu-20.04', 'ubuntu-22.04']
|
|
|
|
fail-fast: false
|
|
|
|
max-parallel: 2
|
|
|
|
|
2020-09-08 15:21:07 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Dependencies
|
|
|
|
run: sudo apt install
|
|
|
|
python3-all
|
|
|
|
python3-stdeb
|
|
|
|
dh-python
|
|
|
|
python3-requests
|
|
|
|
python3-setuptools
|
|
|
|
python3-wheel
|
2022-09-16 11:17:47 +00:00
|
|
|
|
|
|
|
- name: Webview Dependencies
|
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
|
|
run: sudo apt install
|
2022-09-11 14:48:58 +00:00
|
|
|
python3-webview
|
|
|
|
python3-gi
|
|
|
|
python3-gi-cairo
|
|
|
|
gir1.2-gtk-3.0
|
2020-09-08 15:21:07 +00:00
|
|
|
|
|
|
|
- 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
|