Add pyinstaller build #16
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: Linux Build | ||
env: | ||
ECBUILD_SRC: ${{ github.workspace }}/ECBUILD | ||
ECCODES_SRC: ${{ github.workspace }}/source/eccodes | ||
PYGRIB_SRC: ${{ github.workspace }}/PYGRIB | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout grib2pf | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ github.workspace }}/source | ||
submodules: recursive | ||
- name: Checkout ecbuild | ||
shell: bash | ||
run: | | ||
git clone --depth 1 https://github.com/ecmwf/ecbuild.git $env:ECBUILD_SRC | ||
- name: Setup Environment | ||
shell: bash | ||
run: | | ||
sudo apt-get install libaec-dev libpng-dev libcurl4-openssl-dev | ||
- name: Build grib2pf | ||
shell: bash | ||
run: | | ||
mkdir source/build | ||
cd source/build | ||
cmake .. \ | ||
-D CMAKE_BUILD_TYPE=Release | ||
make -j4 | ||
- name: Make grib2pf-advanced | ||
shell: bash | ||
run: | | ||
mkdir -p dist/grib2pf-advanced | ||
cp -rv \ | ||
source/*.py \ | ||
source/build/libgrib2pf.so \ | ||
source/build/lib/*.so \ | ||
source/LICENSE \ | ||
source/README.md \ | ||
source/ACKNOWLEDGMENTS.md \ | ||
source/products.txt \ | ||
source/hrrr_wrfsfcf00_products.csv \ | ||
source/hrrr_wrfsfcf01_products.csv \ | ||
source/examples \ | ||
source/palettes \ | ||
source/presets \ | ||
source/icon \ | ||
source/requirements.txt \ | ||
dist/grib2pf-advanced | ||
patchelf --set-rpath "." dist/grib2pf-advanced/*.so | ||
- name: Upload grib2pf-advanced | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: grib2pf-advanced | ||
path: ${{ github.workspace }}/dist | ||
- name: Install pyinstaller and requirements.txt | ||
shell: bash | ||
run: | | ||
cd source | ||
pip install pyinstaller | ||
pip install -r requirements.txt | ||
- name: Make Executables | ||
shell: bash | ||
cd source | ||
pyinstaller grib2pf.spec | ||
- name: Copy Files to Output | ||
shell: bash | ||
run: | | ||
cd source | ||
cp -rv README.md dist/grib2pf/ | ||
cp -rv ACKNOWLEDGMENTS.md dist/grib2pf/ | ||
cp -rv products.txt dist/grib2pf/_internal | ||
cp -rv hrrr_wrfsfcf00_products.csv dist/grib2pf/_internal | ||
cp -rv hrrr_wrfsfcf01_products.csv dist/grib2pf/_internal | ||
cp -rv examples dist/grib2pf/examples -Recurse | ||
cp -rv palettes dist/grib2pf/_internal/palettes -Recurse | ||
cp -rv presets dist/grib2pf/_internal/presets -Recurse | ||
cp -rv icon dist/grib2pf/_internal/icon -Recurse | ||
- name: Upload grib2pf Executable | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: grib2pf | ||
path: ${{ github.workspace }}/source/dist |