-
Notifications
You must be signed in to change notification settings - Fork 3
Add pyinstaller build #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6da3fb6
add pyinstaller to dev tools,
sjswerdloff 7f76d01
changed from sys.argv[0] to sys.executable per: https://github.com/py…
sjswerdloff 03b74d6
make config file searches work within a pyinstaller executable
sjswerdloff 3134c00
remove .toml files from dist after doing a compress-archive
sjswerdloff e7bca61
bump poetry version to 2.1.1, the repo is using a relatively new vers…
sjswerdloff 9096623
Update tdwii_plus_examples/cli/upsscp/upsscp.py
sjswerdloff 803dc20
Update .github/workflows/build-executables.yml
sjswerdloff 41f6f72
Update .github/workflows/build-executables.yml
sjswerdloff 0918d11
Merge branch 'add_pyinstaller_build' of github.com:sjswerdloff/tdwii_…
sjswerdloff 6d99ec2
fix syntax error, change names to match current repo
sjswerdloff 78c3179
additional corrections for FileExistsError to FileNotFoundError
sjswerdloff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,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/ | ||
sjswerdloff marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - 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 }} | ||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.