mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-08 11:51:48 +00:00
Add GitHub Actions Workflow to build Host EXE (#170)
This commit is contained in:
parent
76de7b10fd
commit
669e39a943
3 changed files with 96 additions and 2 deletions
63
.github/workflows/nxdt_host_exe.yml
vendored
Normal file
63
.github/workflows/nxdt_host_exe.yml
vendored
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
name: Build Host as Windows Executable
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [rewrite]
|
||||||
|
|
||||||
|
paths:
|
||||||
|
- 'host/**'
|
||||||
|
- '.github/workflows/nxdt_host_exe.yml'
|
||||||
|
|
||||||
|
# Allows you to run this workflow manually from the Actions tab.
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set environment variables
|
||||||
|
run: |
|
||||||
|
echo "nxdt_commit=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: 3.12
|
||||||
|
# 3.12.5 was released on 2024-08-06.
|
||||||
|
# See https://www.python.org/downloads/ for available versions.
|
||||||
|
|
||||||
|
- name: Install dependencies and build EXE
|
||||||
|
run: .\host\windows_make_standalone.bat
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nxdt_host-${{ env.nxdt_commit }}.7z
|
||||||
|
path: host/nxdt_host.7z
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload nxdumptool-rewrite PoC artifacts to pre-release
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
# Only update attachments on "rewrite-prerelease" tag.
|
||||||
|
prerelease: True
|
||||||
|
tag: "rewrite-prerelease"
|
||||||
|
updateOnlyUnreleased: True
|
||||||
|
# Replace old artifacts with new ones.
|
||||||
|
removeArtifacts: False
|
||||||
|
replacesArtifacts: True
|
||||||
|
# Update preferences.
|
||||||
|
allowUpdates: True
|
||||||
|
omitBody: True
|
||||||
|
omitBodyDuringUpdate: True
|
||||||
|
omitNameDuringUpdate: True
|
||||||
|
artifacts: "host/nxdt_host.7z"
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2
.github/workflows/rewrite.yml
vendored
2
.github/workflows/rewrite.yml
vendored
|
@ -104,7 +104,7 @@ jobs:
|
||||||
tag: "rewrite-prerelease"
|
tag: "rewrite-prerelease"
|
||||||
updateOnlyUnreleased: True
|
updateOnlyUnreleased: True
|
||||||
# Remove old artifacts and replace with new ones.
|
# Remove old artifacts and replace with new ones.
|
||||||
removeArtifacts: True
|
removeArtifacts: False
|
||||||
replacesArtifacts: True
|
replacesArtifacts: True
|
||||||
# Update preferences.
|
# Update preferences.
|
||||||
allowUpdates: True
|
allowUpdates: True
|
||||||
|
|
|
@ -14,7 +14,38 @@ python -m venv "%venvname%"
|
||||||
|
|
||||||
"%venvpython%" -m pip install --upgrade nuitka -r requirements-win32.txt
|
"%venvpython%" -m pip install --upgrade nuitka -r requirements-win32.txt
|
||||||
|
|
||||||
"%venvpython%" -m nuitka --standalone --deployment --disable-console --windows-icon-from-ico=nxdt.ico --enable-plugin=tk-inter nxdt_host.py
|
REM Useful command line arguments for Nuitka:
|
||||||
|
|
||||||
|
REM --standalone
|
||||||
|
REM Enable standalone mode for output. This allows you to transfer the created
|
||||||
|
REM binary to other machines without it using an existing Python installation.
|
||||||
|
REM It implies these option: "--follow-imports" and "--python-flag=no_site".
|
||||||
|
|
||||||
|
REM --assume-yes-for-downloads
|
||||||
|
REM Allow Nuitka to download external code if necessary, e.g. dependency
|
||||||
|
REM walker, ccache, and even gcc on Windows.
|
||||||
|
|
||||||
|
REM --deployment
|
||||||
|
REM Disable code aimed at making finding compatibility issues easier.
|
||||||
|
REM This will e.g. prevent execution with "-c" argument, which is often
|
||||||
|
REM used by code that attempts run a module, and causes a program to start
|
||||||
|
REM itself over and over potentially.
|
||||||
|
|
||||||
|
REM --windows-console-mode
|
||||||
|
REM Select console mode to use. Default mode is 'force' and creates a console
|
||||||
|
REM window unless the program was started from one. With 'disable' it doesn't
|
||||||
|
REM create or use a console at all. With 'attach' an existing console will be
|
||||||
|
REM used for outputs. Default is 'force'.
|
||||||
|
|
||||||
|
REM --windows-icon-from-ico=nxdt.ico
|
||||||
|
REM Add executable icon. Can be given multiple times for different resolutions
|
||||||
|
REM or files with multiple icons inside.
|
||||||
|
|
||||||
|
REM --enable-plugin=tk-inter
|
||||||
|
REM Enabled plugins. Must be plug-in names. Use '--plugin-list' to query the
|
||||||
|
REM full list and exit.
|
||||||
|
|
||||||
|
"%venvpython%" -m nuitka --standalone --assume-yes-for-downloads --deployment --windows-console-mode=attach --windows-icon-from-ico=nxdt.ico --enable-plugin=tk-inter nxdt_host.py
|
||||||
|
|
||||||
del /F /Q nxdt_host.7z
|
del /F /Q nxdt_host.7z
|
||||||
7z a nxdt_host.7z .\nxdt_host.dist\*
|
7z a nxdt_host.7z .\nxdt_host.dist\*
|
||||||
|
|
Loading…
Reference in a new issue