Skip to content
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

Build PyInstaller on github actions #1687

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
81 changes: 81 additions & 0 deletions .github/workflows/pyinstaller_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: PyInstaller Windows Build

on:
pull_request:
branches:
- 'main'
- 'release-*'
release:

jobs:
test:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%V")"
shell: bash

- name: Cache Mambaforge and Pip packages
uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
path: |
~/conda_pkgs_dir
~/.cache/pip
key:
${{runner.os}}-condapkg-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Setup Mambaforge
uses: conda-incubator/[email protected]
with:
miniforge-version: latest
miniforge-variant: Mambaforge
activate-environment: mantidimaging-dev
auto-activate-base: false
use-mamba: true

- name: Cache Mambaforge environment
uses: actions/cache@v2
id: cache-mambaforge-environment
env:
CACHE_NUMBER: 0
with:
path: ${{env.CONDA}}/envs/mantidimaging-dev
key:
${{runner.os}}-condaenv-${{env.CACHE_NUMBER}}-${{steps.get-date.outputs.date}}-${{hashFiles('environment-dev.yml','conda/meta.yaml')}}

- name: Mantid Imaging developer dependencies
if: steps.cache-mambaforge-environment.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
conda deactivate
python ./setup.py create_dev_env

- name: cuda-toolkit
uses: Jimver/[email protected]
with:
cuda: '10.2.89'

- name: PyInstaller Build
shell: bash -l {0}
run: |
conda activate mantidimaging-dev
mamba install -y cupy=10.2.* --force-reinstall
echo "Cuda path: $CUDA_PATH"
pip install pyinstaller
cd packaging
python PackageWithPyInstaller.py

- name: Archive PyInstalled File
uses: actions/upload-artifact@v3
with:
name: MantidImaging
path: packaging/dist
1 change: 1 addition & 0 deletions docs/release_notes/next.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ Developer Changes
- #1673 : Update license year across the repository from 2022 to 2023
- #1678 : Allow multiple datasets to be opened at once in the GUI when using the CLI `--path` flag
- #1695 : Use FilenameGroup for Load Images
- #1683 : Add single-file PyInstaller build to Actions
2 changes: 1 addition & 1 deletion packaging/PackageWithPyInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

def create_run_options():
run_options = [
'../mantidimaging/__main__.py', '--name=MantidImaging', '--additional-hooks-dir=hooks', '--onefile',
'../mantidimaging/__main__.py', '--name=MantidImaging', '--additional-hooks-dir=hooks',
'--icon=../images/mantid_imaging_unstable_64px.ico'
]

Expand Down