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:
|
2023-01-25 09:23:27 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-06-16 20:05:22 +00:00
|
|
|
|
2023-01-25 09:23:27 +00:00
|
|
|
- uses: actions/setup-python@v4
|
2020-06-16 20:05:22 +00:00
|
|
|
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: Legendary dependencies and build tools
|
|
|
|
run: pip3 install --upgrade
|
2022-11-06 16:17:53 +00:00
|
|
|
setuptools
|
2021-10-28 08:59:09 +00:00
|
|
|
pyinstaller
|
|
|
|
requests
|
2023-06-18 03:08:56 +00:00
|
|
|
filelock
|
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 }}
|
2022-11-04 15:15:46 +00:00
|
|
|
-i ../assets/windows_icon.ico
|
2020-06-16 20:05:22 +00:00
|
|
|
cli.py
|
2021-10-28 08:22:36 +00:00
|
|
|
env:
|
|
|
|
PYTHONOPTIMIZE: 1
|
2020-06-16 20:05:22 +00:00
|
|
|
|
2023-01-25 09:23:27 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-06-16 20:05:22 +00:00
|
|
|
with:
|
|
|
|
name: ${{ runner.os }}-package
|
|
|
|
path: legendary/dist/*
|
2020-09-08 15:21:07 +00:00
|
|
|
|
|
|
|
deb:
|
2022-11-04 15:12:54 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2022-09-16 11:17:47 +00:00
|
|
|
|
2020-09-08 15:21:07 +00:00
|
|
|
steps:
|
2023-01-25 09:23:27 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-09-08 15:21:07 +00:00
|
|
|
|
|
|
|
- name: Dependencies
|
2023-01-25 09:23:27 +00:00
|
|
|
run: |
|
|
|
|
sudo apt install ruby
|
|
|
|
sudo gem install fpm
|
2020-09-08 15:21:07 +00:00
|
|
|
|
|
|
|
- name: Build
|
2023-01-25 09:23:27 +00:00
|
|
|
run: fpm
|
|
|
|
--input-type python
|
|
|
|
--output-type deb
|
|
|
|
--python-package-name-prefix python3
|
|
|
|
--deb-suggests python3-webview
|
|
|
|
--maintainer "Rodney <rodney@rodney.io>"
|
|
|
|
--category python
|
|
|
|
--depends "python3 >= 3.9"
|
|
|
|
setup.py
|
2020-09-08 15:21:07 +00:00
|
|
|
|
|
|
|
- name: Os version
|
|
|
|
id: os_version
|
|
|
|
run: |
|
|
|
|
source /etc/os-release
|
|
|
|
echo ::set-output name=version::$NAME-$VERSION_ID
|
|
|
|
|
2023-01-25 09:23:27 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2020-09-08 15:21:07 +00:00
|
|
|
with:
|
|
|
|
name: ${{ steps.os_version.outputs.version }}-deb-package
|
2023-01-25 09:23:27 +00:00
|
|
|
path: ./*.deb
|