rework build files and binary includes #65
This file contains 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
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "**" | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
name: Windows Build | |
env: | |
ECBUILD_SRC: ${{ github.workspace }}/ECBUILD | |
ECCODES_SRC: ${{ github.workspace }}/source/eccodes | |
PYGRIB_SRC: ${{ github.workspace }}/PYGRIB | |
runs-on: windows-2022 | |
steps: | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
python-version: "3.11" | |
- name: Checkout grib2pf | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ github.workspace }}/source | |
- name: Configure eccodes | |
shell: pwsh | |
run: | | |
git config --global core.symlinks true | |
conda config --set always_yes yes | |
- name: Checkout eccodes | |
shell: pwsh | |
run: | | |
git clone --depth 1 https://github.com/ecmwf/eccodes.git $env:ECCODES_SRC | |
cd $env:ECCODES_SRC | |
git fetch --all --tags --prune | |
git checkout tags/2.38.0 | |
- name: Checkout ecbuild | |
shell: pwsh | |
run: | | |
git clone --depth 1 https://github.com/ecmwf/ecbuild.git $env:ECBUILD_SRC | |
- name: Install Conda Packages | |
shell: pwsh | |
run: | | |
conda install -c msys2 ` | |
m2-bash ` | |
m2-findutils ` | |
m2-coreutils ` | |
m2-grep ` | |
m2-sed ` | |
m2-gawk ` | |
m2-diffutils ` | |
m2-perl ` | |
m2w64-ntldd-git | |
conda install -c conda-forge cmake libaec libpng | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
vsversion: 2022 | |
- name: Build grib2pf | |
shell: pwsh | |
run: | | |
mkdir source/build | |
cd source/build | |
cmake -G "NMake Makefiles" ` | |
-D CMAKE_BUILD_TYPE=Release ` | |
.. | |
set CL /MP | |
nmake | |
- name: Install pyinstaller and requirements.txt | |
shell: pwsh | |
run: | | |
cd ${{ github.workspace }}/source | |
pip install pyinstaller | |
pip install -r requirements.txt | |
- name: Make Executables | |
shell: pwsh | |
run: | | |
cd ${{ github.workspace }}/source | |
pyinstaller grib2pf.spec | |
- name: Copy Files to Output | |
shell: pwsh | |
run: | | |
cd ${{ github.workspace }}/source | |
ls build | |
ls build/* | |
Copy-Item build/grib2pf.dll dist/grib2pf/_internal | |
Copy-Item build/lib/eccodes.dll dist/grib2pf/_internal | |
Copy-Item build/lib/eccodes_memfs.dll dist/grib2pf/_internal | |
Copy-Item README.md dist/grib2pf/ | |
Copy-Item ACKNOWLEDGMENTS.md dist/grib2pf/ | |
Copy-Item products.txt dist/grib2pf/_internal | |
Copy-Item examples dist/grib2pf/examples -Recurse | |
Copy-Item palettes dist/grib2pf/_internal/palettes -Recurse | |
Copy-Item presets dist/grib2pf/_internal/presets -Recurse | |
Copy-Item icon dist/grib2pf/_internal/icon -Recurse | |
- name: Upload grib2pf Executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: grib2pf | |
path: ${{ github.workspace }}/source/dist | |
# - name: Test eccodes | |
# shell: pwsh | |
# run: | | |
# cd build | |
# $env:Path += ";${{ github.workspace }}/build/bin" | |
# ctest -j4 --output-on-failure |