-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: added workflow to build & upload artifacts for various platforms
In theory this workflow should generate binaries for Windows, macOS and Linux. The universal2 target for macOS might not work with Python 3.9 See: - actions/runner-images#4133 (comment) - pyinstaller/pyinstaller#5315 (comment)
- Loading branch information
Showing
3 changed files
with
77 additions
and
2 deletions.
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,68 @@ | ||
name: Artifacts | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
unix-build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Generate Binary | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry install | ||
OS=$(uname -s | tr A-Z a-z) | ||
VERSION=$(poetry version) | cut -d " " -f 2 | ||
pyinstaller --target-architecture=universal2 --noconsole --clean --noconfirm --onefile run_away/__main__.py --name "run-away-$VERSION-$OS" --add-data "run_away/resources:resources" | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/run-away.* | ||
|
||
windows-build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python 3.9 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Generate Binary | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry install | ||
VERSION=$(poetry version) | cut -d " " -f 2 | ||
pyinstaller --noconsole --clean --noconfirm --onefile run_away/__main__.py --name "run-away-$VERSION-windows" --add-data "run_away/resources;resources" | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/run-away.* |
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
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 |
---|---|---|
|
@@ -166,4 +166,5 @@ cython_debug/ | |
.vscode/settings.json | ||
|
||
# PyInstaller | ||
!*.spec | ||
!run-away.spec | ||
!run-away-debug.spec |