mirror of
https://github.com/derrod/legendary.git
synced 2025-01-05 05:15:28 +00:00
94 lines
2 KiB
YAML
94 lines
2 KiB
YAML
name: Python
|
|
|
|
on:
|
|
push:
|
|
branches: [ '*' ]
|
|
pull_request:
|
|
branches: [ '*' ]
|
|
|
|
jobs:
|
|
pyinstaller:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: ['ubuntu-20.04', 'windows-2019', 'macos-11']
|
|
fail-fast: false
|
|
max-parallel: 3
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.9'
|
|
|
|
- name: Update packaging tools
|
|
run: pip install --upgrade
|
|
pip
|
|
wheel
|
|
setuptools
|
|
pipenv
|
|
|
|
- name: Install dependencies
|
|
run: pipenv install --system --dev
|
|
|
|
- name: Optional dependencies (WebView)
|
|
run: pipenv install --system --categories="webview"
|
|
if: runner.os != 'macOS'
|
|
|
|
- name: Set strip option on non-Windows
|
|
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 }}
|
|
-i ../assets/windows_icon.ico
|
|
cli.py
|
|
env:
|
|
PYTHONOPTIMIZE: 1
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ runner.os }}-package
|
|
path: legendary/dist/*
|
|
|
|
deb:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '3.0'
|
|
|
|
- name: Install fpm
|
|
run: gem install fpm
|
|
|
|
- name: Build
|
|
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
|
|
|
|
- name: OS version
|
|
id: os_version
|
|
run: |
|
|
source /etc/os-release
|
|
echo ::set-output name=version::$NAME-$VERSION_ID
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.os_version.outputs.version }}-deb-package
|
|
path: ./*.deb
|