Skip to content

just cleanups and added some outputs ... #122

just cleanups and added some outputs ...

just cleanups and added some outputs ... #122

name: Build Monica Package on Windows
on:
push:
branches: [ "master" ]
jobs:
windows:
runs-on: windows-latest
steps:
# main repository monica
- name: Checkout repository
uses: actions/checkout@v4
with:
path: "monica"
# dependent repository mas-infrastructure
- name: Checkout dependent repository
uses: actions/checkout@v4
with:
repository: zalf-rpm/mas-infrastructure
ref: master
path: "mas-infrastructure"
- name: Checkout dependent repository
uses: actions/checkout@v4
with:
repository: zalf-rpm/monica-parameters
ref: master
path: "monica-parameters"
- name: Read vcpkg tag to use
id: vcpkg_tag
run: |
echo "vcpkg_tag=$(cat ./monica/vcpkg_tag.txt)" >> $GITHUB_OUTPUT
- name: Checkout vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
ref: ${{ steps.vcpkg_tag.outputs.vcpkg_tag }}
path: "vcpkg"
- name: Debug directory structure
run: |
echo ${{ github.workspace }}
pwd
ls
ls monica
ls mas-infrastructure
ls monica-parameters
ls vcpkg
- name: Set up MSVC compiler
uses: microsoft/setup-msbuild@v1.1
with:
vs-version: '17.9'
msbuild-architecture: 'x64'
- name: Install vcpkg dependencies
run: |
pwd
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install zeromq:x64-windows-static capnproto:x64-windows-static libsodium:x64-windows-static
- name: Create build folder
working-directory: ./monica
run: |
pwd
mkdir _cmake_win64
- name: Configure CMake
working-directory: ./monica/_cmake_win64
run: |
pwd
cmake -G "Visual Studio 17 2022" .. -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
- name: Build Monica
working-directory: ./monica/_cmake_win64
run: |
msbuild Monica.sln /p:Configuration=Release /p:Platform=x64
- name: package Monica
run: |
mkdir monica_${{ github.ref_name }}
mkdir monica_${{ github.ref_name }}/bin
mkdir monica_${{ github.ref_name }}/documentation
mkdir monica_${{ github.ref_name }}/bin/soil
mkdir monica_${{ github.ref_name }}/monica-parameters
mkdir monica_${{ github.ref_name }}/projects
mkdir monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer
mkdir monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python
mkdir monica_${{ github.ref_name }}/projects/Hohenfinow2-single-run
cp monica-parameters/soil/CapillaryRiseRates.sercapnp monica_${{ github.ref_name }}/bin/soil/
cp monica-parameters/soil/SoilCharacteristicData.sercapnp monica_${{ github.ref_name }}/bin/soil/
cp monica-parameters/soil/SoilCharacteristicModifier.sercapnp monica_${{ github.ref_name }}/bin/soil/
cp monica/_cmake_win64/Release/monica-run.exe monica_${{ github.ref_name }}/bin/
cp monica/_cmake_win64/Release/monica-zmq-proxy.exe monica_${{ github.ref_name }}/bin/
cp monica/_cmake_win64/Release/monica-zmq-server.exe monica_${{ github.ref_name }}/bin/
cp monica/_cmake_win64/Release/monica-capnp-server.exe monica_${{ github.ref_name }}/bin/
cp monica/_cmake_win64/Release/monica-capnp-fbp-component.exe monica_${{ github.ref_name }}/bin/
cp monica/_cmake_win64/mas-infrastructure/common/Release/channel.exe monica_${{ github.ref_name }}/bin/
cp -r monica-parameters monica_${{ github.ref_name }}/monica-parameters/
cp monica/LICENSE monica_${{ github.ref_name }}/bin/
cp monica/documentation/de_benutzerhandbuch_MONICA_windows.pdf monica_${{ github.ref_name }}/documentation/
cp monica/documentation/en_user_manual_MONICA_windows.pdf monica_${{ github.ref_name }}/documentation/
cp -r monica-parameters/crop-residues monica_${{ github.ref_name }}/monica-parameters/
cp -r monica-parameters/crops monica_${{ github.ref_name }}/monica-parameters/
cp -r monica-parameters/mineral-fertilisers monica_${{ github.ref_name }}/monica-parameters/
cp -r monica-parameters/organic-fertilisers monica_${{ github.ref_name }}/monica-parameters/
cp -r monica-parameters/general monica_${{ github.ref_name }}/monica-parameters/
cp -r monica-parameters/soil monica_${{ github.ref_name }}/monica-parameters/
cp monica/installer/Hohenfinow2/crop-min.json monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/
cp monica/installer/Hohenfinow2/site-min.json monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/
cp monica/installer/Hohenfinow2/sim-min.json monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/
cp monica/installer/Hohenfinow2/climate-min.csv monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/
cp monica/installer/Hohenfinow2/python/run-producer.py monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python/
cp monica/installer/Hohenfinow2/python/run-consumer.py monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python/
cp monica/installer/Hohenfinow2/python/start_monica_server.cmd monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python/
cp monica/installer/Hohenfinow2/python/start_consumer.cmd monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python/
cp monica/installer/Hohenfinow2/python/start_producer.cmd monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python/
cp monica/installer/Hohenfinow2/python/start_producer_consumer_pipeline.cmd monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python/
cp monica/installer/Hohenfinow2/python/README_pipeline.md monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/README.md
cp monica/installer/Hohenfinow2/crop.json monica_${{ github.ref_name }}/projects/Hohenfinow2-single-run/
cp monica/installer/Hohenfinow2/site.json monica_${{ github.ref_name }}/projects/Hohenfinow2-single-run/
cp monica/installer/Hohenfinow2/sim.json monica_${{ github.ref_name }}/projects/Hohenfinow2-single-run/
cp monica/installer/Hohenfinow2/climate.csv monica_${{ github.ref_name }}/projects/Hohenfinow2-single-run/
cp monica/installer/Hohenfinow2/python/run_monica.cmd monica_${{ github.ref_name }}/projects/Hohenfinow2-single-run/
cp monica/installer/Hohenfinow2/python/README_single.md monica_${{ github.ref_name }}/projects/Hohenfinow2-single-run/README.md
Compress-Archive -Path monica_${{ github.ref_name }}/* -Destination monica_win64_${{ github.ref_name }}.zip