-
Notifications
You must be signed in to change notification settings - Fork 10
142 lines (121 loc) · 7.78 KB
/
windows_build_install_package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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: Checkout vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
ref: master
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 }}/bin/monica-ini-to-json
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-proxy.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 mas-infrastructure/src/python/pkgs/model/monica_io3.py monica_${{ github.ref_name }}/bin/
cp mas-infrastructure/src/python/pkgs/soil/soil_io3.py monica_${{ github.ref_name }}/bin/
cp monica/src/python/monica-ini-to-json/monica-ini-to-json.py monica_${{ github.ref_name }}/bin/monica-ini-to-json/
cp monica/src/python/monica-ini-to-json/conversion-template-sim.json monica_${{ github.ref_name }}/bin/monica-ini-to-json/
cp monica/src/python/monica-ini-to-json/conversion-template-site.json monica_${{ github.ref_name }}/bin/monica-ini-to-json/
cp monica/src/python/monica-ini-to-json/conversion-template-crop.json monica_${{ github.ref_name }}/bin/monica-ini-to-json/
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 mas-infrastructure/src/python/pkgs/soil/soil_io3.py monica_${{ github.ref_name }}/projects/Hohenfinow2-producer-consumer/python/
cp mas-infrastructure/src/python/pkgs/model/monica_io3.py 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