FreeDATA/.github/workflows/build_nsis_bundle.yml

107 lines
3.3 KiB
YAML

name: Build and Release NSIS Installer
on: [push]
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install NSIS via choco
run: choco install nsis
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v7
with:
node-version: 24
- name: Vue Builder
working-directory: freedata_gui
run: |
npm i
npm run build
- name: LIST ALL FILES
run: ls -R
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install .[nuitka]
- uses: robinraju/release-downloader@v1.13
with:
repository: "Hamlib/Hamlib"
fileName: "hamlib-w64-*.zip"
# latest: true
extract: true
tag: '4.6.5'
out-file-path: "freedata_server/lib/hamlib"
- name: Move Hamlib Files
working-directory: freedata_server
run: |
# Find the downloaded folder (handle version numbers dynamically)
$HAMLIB_DIR = Get-ChildItem -Directory -Path lib/hamlib -Filter "hamlib-w64*" | Select-Object -First 1
# Move all contents from the found directory to the target directory
Move-Item "$($HAMLIB_DIR.FullName)\*" "lib/hamlib" -Force
# Remove the now empty versioned directory
Remove-Item "$($HAMLIB_DIR.FullName)" -Recurse -Force
shell: pwsh
- name: Build binaries
working-directory: freedata_server
run: |
python3 -m nuitka `
--remove-output `
--assume-yes-for-downloads `
--follow-imports `
--include-data-dir=lib=lib `
--include-data-dir=../freedata_gui/dist=gui `
--include-data-files=lib/codec2/*=lib/codec2/ `
--include-data-files=lib/hamlib/bin/*.exe=lib/hamlib/bin/ `
--include-data-files=lib/hamlib/bin/*.dll=lib/hamlib/bin/ `
--include-data-files=config.ini.example=config.ini `
--nofollow-import-to=sqlalchemy.dialects.mysql,sqlalchemy.dialects.mariadb,sqlalchemy.dialects.postgresql,sqlalchemy.dialects.oracle,sqlalchemy.dialects.mssql `
--include-package=sqlalchemy.dialects.sqlite `
--standalone server.py `
--output-filename=freedata-server `
--low-memory
shell: pwsh
- name: LIST ALL FILES
run: ls -R
- name: Create installer
uses: joncloud/makensis-action@v5.0
with:
script-file: "freedata-nsis-config.nsi"
arguments: '/V3'
- name: LIST ALL FILES
working-directory: freedata_server/server.dist
run: ls -R
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: 'FreeDATA-Installer'
path: ./FreeDATA-Installer.exe
- name: Upload Installer to Release
uses: softprops/action-gh-release@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: false
files: ./FreeDATA-Installer.exe
tag_name: ${{ github.ref_name }}