Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/workflows/build-executables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Build Executables

on:
workflow_dispatch: # Manual trigger

permissions:
contents: write # This allows creating releases and tags

jobs:
build:
strategy:
matrix:
os: [windows-latest] # , macos-latest, ubuntu-latest]
include:
- os: windows-latest
platform-name: windows
asset-name: tdwii_config_dump
path-sep: ";"

# - os: macos-latest
# platform-name: macos
# asset-name: dcmQTreePy-macos
# path-sep: ":"

# - os: ubuntu-latest
# platform-name: ubuntu
# asset-name: dcmQTreePy-ubuntu
# path-sep: ":"

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies with Poetry
shell: bash
run: |
poetry install --with=dev

- name: Build with PyInstaller (Windows)
if: matrix.os == 'windows-latest'
shell: bash
run: |
poetry run pyinstaller --onefile --name=tdwii_config_dump.exe tdwii_plus_examples/cli/config_dump.py
poetry run pyinstaller --onefile --windowed --name=eScheduler.exe tdwii_plus_examples/rtbdi_creator/mainbdiwidget.py
poetry run pyinstaller --onefile --windowed --name=ppvs_proxy.exe tdwii_plus_examples/TDWII_PPVS_subscriber/ppvs_subscriber_widget.py
poetry run pyinstaller --onefile --name=eTMS.exe tdwii_plus_examples/cli/upsscp/upsscp.py
cp rtbdi.toml dist/
cp ppvs.toml dist/
mkdir dist/config
cp ./tdwii_plus_examples/config/ApplicationEntities.json dist/config/
cp ./tdwii_plus_examples/config/MachineMap.json dist/config/
cp ./tdwii_plus_examples/cli/upsscp/config/upsscp_default.ini dist/config


# - name: Create distribution package (macOS/Linux)
# if: matrix.os != 'windows-latest'
# run: |
# mkdir dist-package
# if [ "${{ matrix.os }}" = "macos-latest" ]; then
# cp -r dist/dcmQTreePy.app dist-package/
# # Create a DMG file for easier distribution
# hdiutil create -volname dcmQTreePy -srcfolder dist-package -ov -format UDZO dist/dcmQTreePy.dmg
# elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
# cp -r dist/dcmQTreePy dist-package/
# # Create a tarball for Linux
# tar -czvf dist/dcmQTreePy-linux.tar.gz -C dist-package .
# fi
# shell: bash

- name: Create distribution package (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Compress-Archive -Path "dist/config" -DestinationPath "dist/config.zip" -Force
Remove-Item -Path "dist/config" -Force
Compress-Archive -Path "dist/" -DestinationPath "./twdii_plus_examples.zip" -Force
Remove-Item -Path "dist/*.exe" -Force
Remove-Item -Path "dist/config.zip" -Force
Copy-Item -Path "./twdii_plus_examples.zip" -DestinationPath "dist/" -Force

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset-name }}
path: dist/

- name: Create Release
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/heads/main'
with:
tag_name: v${{ github.run_number }}
name: Release ${{ github.run_number }}
draft: true
files: |
dist/

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: nbstripout

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.0 # Specify the latest Ruff version
rev: v0.11.10 # Specify the latest Ruff version
hooks:
- id: ruff
types: [python]
Expand Down
Loading