-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a6ba5b
commit 56ff7e9
Showing
3 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Build App with Pyinstaller | ||
|
||
on: | ||
pull_request: | ||
# inputs: | ||
# platform: | ||
# description: 'platform' | ||
# required: true | ||
# default: 'macos-latest' | ||
# type: choice | ||
# options: | ||
# - 'windows-latest' | ||
# - 'macos-latest' | ||
# - 'ubuntu-latest' | ||
|
||
jobs: | ||
build: | ||
env: | ||
platform: ubuntu-latest | ||
name: ubuntu-latest # ${{ env.platform }} | ||
runs-on: ubuntu-latest # ${{ env.platform }} | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Conda (windows) | ||
if: env.platform == 'windows-latest' | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: '' | ||
|
||
- name: Install Monopoly dependencies (windows) | ||
if: env.platform == 'windows-latest' | ||
run: | | ||
conda install -c conda-forge poppler | ||
pip install -r requirements.txt | ||
- name: Install Monopoly dependencies (ubuntu/mac) | ||
if: env.platform == 'macos-latest' || env.platform == 'ubuntu-latest' | ||
uses: daaku/gh-action-apt-install@v4 | ||
with: | ||
packages: build-essential libpoppler-cpp-dev pkg-config | ||
|
||
- name: Install Rust for ubuntu-latest | ||
if: env.platform == 'ubuntu-latest' | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
target: x86_64-unknown-linux-musl | ||
|
||
- name: Install Rust for windows-latest | ||
if: env.platform == 'windows-latest' | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable-x86_64-msvc | ||
target: x86_64-pc-windows-msvc | ||
|
||
- name: Install Rust for macos-latest | ||
if: env.platform == 'macos-latest' | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
target: x86_64-apple-darwin | ||
|
||
- name: Get host type | ||
run: | | ||
host=$(rustc -Vv | grep host) | ||
echo "HOST=$(echo $host | cut -f2 -d' ')" >> $GITHUB_ENV | ||
- name: Create executable | ||
uses: sayyid5416/pyinstaller@v1 | ||
with: | ||
python_ver: '3.11' | ||
pyinstaller_ver: '==6.8.0' | ||
spec: entrypoint.spec | ||
requirements: requirements.txt | ||
options: --onefile, --name "monopoly" | ||
upload_exe_with_name: 'monopoly-${{ env.HOST }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# pylint: disable=invalid-name | ||
import site | ||
|
||
from PyInstaller.utils.hooks import collect_submodules | ||
|
||
site_packages_dir = site.getsitepackages()[0] | ||
datas = [(f"{site_packages_dir}/monopoly_streamlit", "./monopoly_streamlit")] | ||
datas = [("./monopoly_streamlit", "./monopoly_streamlit")] | ||
hiddenimports = collect_submodules("monopoly_streamlit") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# pylint: disable=invalid-name | ||
|
||
from PyInstaller.utils.hooks import collect_submodules | ||
|
||
hiddenimports = collect_submodules("streamlit_extras") |