-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from emcek/improve_relese_ci
Improve Release CI pipeline
- Loading branch information
Showing
13 changed files
with
209 additions
and
95 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,79 @@ | ||
name: Build dcspy binary with Nuitka | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
nuitka_type: [ dcspy_nuitka, dcspy_nuitka_cli ] | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python environment" | ||
uses: ./.github/actions/setup-python | ||
|
||
- name: "Generate version info file" | ||
shell: pwsh | ||
id: nuitka_data | ||
run: | | ||
python -m pip install -U pyinstaller | ||
$output = & python scripts/generate_ver_file.py | ||
$output = $output -replace "[\(\)\s\']", "" | ||
$values = $output.Split(',') | ||
$ref_name = $values[0].Trim() | ||
$run_number = $values[1].Trim() | ||
$sha = $values[2].Trim() | ||
Write-Output "git_ref_name=$ref_name" >> $env:GITHUB_OUTPUT | ||
Write-Output "git_run_number=$run_number" >> $env:GITHUB_OUTPUT | ||
Write-Output "git_sha=$sha" >> $env:GITHUB_OUTPUT | ||
- uses: Nuitka/Nuitka-Action@main | ||
if: ${{ endsWith( matrix.nuitka_type, '_nuitka') }} | ||
with: | ||
nuitka-version: 2.4.8 | ||
script-name: src/dcs_py.py | ||
onefile: true | ||
windows-console-mode: disable | ||
prefer-source-code: true | ||
enable-plugins: pyside6 | ||
include-package-data: dcspy | ||
assume-yes-for-downloads: true | ||
onefile-windows-splash-screen-image: src/dcspy/img/splash.png | ||
output-file: ${{ matrix.nuitka_type }} | ||
output-dir: dist | ||
windows-icon-from-ico: src/dcspy/img/dcspy_white.ico | ||
product-name: DCSpy | ||
file-version: ${{ steps.nuitka_data.outputs.git_ref_name }}.${{ steps.nuitka_data.outputs.git_run_number }} | ||
product-version: ${{ steps.nuitka_data.outputs.git_ref_name }}.${{ steps.nuitka_data.outputs.git_sha }} | ||
file-description: Integrating DCS Planes with Logitech keyboards with LCD | ||
copyright: (c) 2024 Michal Plichta. All rights reserved. | ||
|
||
- uses: Nuitka/Nuitka-Action@main | ||
if: ${{ endsWith( matrix.nuitka_type, '_cli') }} | ||
with: | ||
nuitka-version: 2.4.8 | ||
script-name: src/dcs_py.py | ||
onefile: true | ||
windows-console-mode: force | ||
prefer-source-code: true | ||
enable-plugins: pyside6 | ||
include-package-data: dcspy | ||
assume-yes-for-downloads: true | ||
onefile-windows-splash-screen-image: src/dcspy/img/splash.png | ||
output-file: ${{ matrix.nuitka_type }} | ||
output-dir: dist | ||
windows-icon-from-ico: src/dcspy/img/dcspy_white.ico | ||
product-name: DCSpy | ||
file-version: ${{ steps.nuitka_data.outputs.git_ref_name }}.${{ steps.nuitka_data.outputs.git_run_number }} | ||
product-version: ${{ steps.nuitka_data.outputs.git_ref_name }}.${{ steps.nuitka_data.outputs.git_sha }} | ||
file-description: Integrating DCS Planes with Logitech keyboards with LCD | ||
copyright: (c) 2024 Michal Plichta. All rights reserved. | ||
|
||
- name: "Upload dcspy binaries" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.nuitka_type }}_nuitka | ||
path: dist/${{ matrix.nuitka_type }}.exe |
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,52 @@ | ||
name: Build dcspy binary with PyInstaller | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
spec_file: [ dcspy, dcspy_cli ] | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python environment" | ||
uses: ./.github/actions/setup-python | ||
|
||
- name: "Compile and install PyInstaller" | ||
shell: bash | ||
run: | | ||
git clone https://github.com/pyinstaller/pyinstaller.git | ||
pyi_tag=$(python scripts/latest_tag.py pyinstaller 1) | ||
pyi_ver=$(python scripts/latest_tag.py pyinstaller 0) | ||
cd pyinstaller/bootloader | ||
git checkout $pyi_tag | ||
python.exe ./waf all | ||
cd .. | ||
python -m build | ||
python -m twine check dist/* | ||
pip install dist/pyinstaller-$pyi_ver-py3-none-any.whl | ||
- name: "Generate version info file" | ||
shell: bash | ||
run: | | ||
python scripts/generate_ver_file.py | ||
- name: "Build dcspy binaries" | ||
shell: bash | ||
run: | | ||
export SOURCE_DATE_EPOCH=1674687685 | ||
export PYTHONHASHSEED=1674687685 | ||
pyinstaller --clean --noconfirm --log-level INFO ${{ matrix.spec_file }}.spec | ||
md5sum dist/*.exe | ||
unset PYTHONHASHSEED | ||
unset SOURCE_DATE_EPOCH | ||
pyi-bindepend dist/*.exe | ||
- name: "Upload dcspy binaries" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.spec_file }}_pyinstaller | ||
path: dist/${{ matrix.spec_file }}.exe |
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
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,27 @@ | ||
name: Build dcspy wheel package | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python environment" | ||
uses: ./.github/actions/setup-python | ||
|
||
- name: "Build dcspy wheel package" | ||
shell: bash | ||
run: | | ||
python -m build | ||
python -m twine check dist/* | ||
- name: "Upload dcspy wheel" | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dcspy_wheel | ||
path: | | ||
dist/*.whl | ||
dist/*.tar.gz |
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
Oops, something went wrong.