diff --git a/.github/workflows/pyinstaller_windows.yml b/.github/workflows/pyinstaller_windows.yml new file mode 100644 index 00000000000..cd6f89c1a5c --- /dev/null +++ b/.github/workflows/pyinstaller_windows.yml @@ -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/setup-miniconda@v2.1.1 + 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/cuda-toolkit@v0.2.8 + 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 diff --git a/docs/release_notes/next.rst b/docs/release_notes/next.rst index bf4ae3834f8..47ead424b15 100644 --- a/docs/release_notes/next.rst +++ b/docs/release_notes/next.rst @@ -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 diff --git a/packaging/PackageWithPyInstaller.py b/packaging/PackageWithPyInstaller.py index 4d9aae970dc..114c3e43004 100644 --- a/packaging/PackageWithPyInstaller.py +++ b/packaging/PackageWithPyInstaller.py @@ -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' ]