From ce44e04014476c0cb8af9f1f75374ee1754a7fa6 Mon Sep 17 00:00:00 2001 From: Artur Glavic Date: Tue, 3 Dec 2024 16:11:04 +0100 Subject: [PATCH] add windows build to release action --- .github/workflows/release.yml | 31 +++++++++++++++++++++++- conda_windows.yml | 43 ++++++++++++++++++++++++++++++++++ libeos/__init__.py | 2 +- windows_build.spec | 2 +- windows_folder.spec | 44 +++++++++++++++++++++++++++++++++++ 5 files changed, 119 insertions(+), 3 deletions(-) create mode 100644 conda_windows.yml create mode 100644 windows_folder.spec diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6cad2d9..d3545cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,32 @@ jobs: path: | dist/*.tar.gz + build-windows: + runs-on: windows-latest + if: ${{ (github.event_name != 'workflow_dispatch') || (contains(fromJson('["all", "windows"]'), github.event.inputs.build-items)) }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install dependencies + run: | + C:\Miniconda\condabin\conda.bat env update --file conda_windows.yml --name base + C:\Miniconda\condabin\conda.bat init powershell + - name: Build with pyinstaller + run: | + pyinstaller windows_folder.spec + cd dist\eos + Compress-Archive -Path .\* -Destination ..\..\eos.zip + - name: Archive distribution + uses: actions/upload-artifact@v4 + with: + name: windows-dist + path: | + eos.zip + release: if: github.event_name != 'workflow_dispatch' runs-on: ubuntu-latest @@ -61,8 +87,11 @@ jobs: - uses: actions/download-artifact@v4 with: name: linux-dist + - uses: actions/download-artifact@v4 + with: + name: windows-dist - uses: ncipollo/release-action@v1 with: - artifacts: "amor*.tar.gz" + artifacts: "amor*.tar.gz,*.zip" token: ${{ secrets.GITHUB_TOKEN }} allowUpdates: true diff --git a/conda_windows.yml b/conda_windows.yml new file mode 100644 index 0000000..14b5faa --- /dev/null +++ b/conda_windows.yml @@ -0,0 +1,43 @@ +name: eos_build +channels: + - defaults +dependencies: + - altgraph=0.17.3=py312haa95532_0 + - blas=1.0=mkl + - bzip2=1.0.8=h2bbff1b_6 + - ca-certificates=2024.11.26=haa95532_0 + - expat=2.6.3=h5da7b33_0 + - h5py=3.12.1=py312h3b2c811_0 + - hdf5=1.12.1=h51c971a_3 + - icc_rt=2022.1.0=h6049295_2 + - intel-openmp=2023.1.0=h59b6b97_46320 + - libffi=3.4.4=hd77b12b_1 + - llvmlite=0.43.0=py312hf2fb9eb_0 + - mkl=2023.1.0=h6b88ed4_46358 + - mkl-service=2.4.0=py312h2bbff1b_1 + - mkl_fft=1.3.11=py312h827c3e9_0 + - mkl_random=1.2.8=py312h0158946_0 + - numba=0.60.0=py312h0158946_0 + - numpy=1.26.4=py312hfd52020_0 + - numpy-base=1.26.4=py312h4dde369_0 + - openssl=3.0.15=h827c3e9_0 + - packaging=24.1=py312haa95532_0 + - pefile=2023.2.7=py312haa95532_0 + - pip=24.2=py312haa95532_0 + - pyinstaller=6.9.0=py312h0416ee5_0 + - pyinstaller-hooks-contrib=2024.7=py312haa95532_0 + - python=3.12.7=h14ffc60_0 + - pywin32-ctypes=0.2.2=py312haa95532_0 + - setuptools=75.1.0=py312haa95532_0 + - sqlite=3.45.3=h2bbff1b_0 + - tbb=2021.8.0=h59b6b97_0 + - tk=8.6.14=h0416ee5_0 + - tzdata=2024b=h04d1e81_0 + - vc=14.40=h2eaa2aa_1 + - vs2015_runtime=14.40.33807=h98bb1dd_1 + - wheel=0.44.0=py312haa95532_0 + - xz=5.4.6=h8cc25b3_1 + - zlib=1.2.13=h8cc25b3_1 + - pip: + - orsopy==1.2.1 + - pyyaml==6.0.2 diff --git a/libeos/__init__.py b/libeos/__init__.py index eab079d..3ed2095 100644 --- a/libeos/__init__.py +++ b/libeos/__init__.py @@ -3,4 +3,4 @@ Package to handle data redction at AMOR instrument to be used by eos.py script. """ __version__ = '2.1.2' -__date__ = '2024-10-30' +__date__ = '2024-12-03' diff --git a/windows_build.spec b/windows_build.spec index 00bff38..c933036 100644 --- a/windows_build.spec +++ b/windows_build.spec @@ -12,7 +12,7 @@ a = Analysis( runtime_hooks=[], excludes=[], noarchive=False, - optimize=0, + optimize=1, ) pyz = PYZ(a.pure) diff --git a/windows_folder.spec b/windows_folder.spec new file mode 100644 index 0000000..da3e9b1 --- /dev/null +++ b/windows_folder.spec @@ -0,0 +1,44 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['eos.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=1, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='eos', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) +coll = COLLECT( + exe, + a.binaries, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='eos', +)