-
Notifications
You must be signed in to change notification settings - Fork 10
171 lines (142 loc) · 8.1 KB
/
on-tag.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Tag Created Workflow
on:
push:
tags:
- '*'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# login to docker hub
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
# push with just the tag
tags: zalfrpm/monica-cluster:${{ github.ref_name }}
# create a follow up job to build on windows
windows:
runs-on: windows-latest
steps:
# main repository monica
- name: Checkout repository
uses: actions/checkout@v3
with:
path: "monica"
# dependent repository mas-infrastructure
- name: Checkout dependent repository
uses: actions/checkout@v3
with:
repository: zalf-rpm/mas-infrastructure
ref: master
path: "mas-infrastructure"
- name: Checkout dependent repository
uses: actions/checkout@v3
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@v3
with:
repository: microsoft/vcpkg
ref: ${{ steps.vcpkg_tag.outputs.vcpkg_tag }}
path: "vcpkg"
- name: Set up MSVC compiler
uses: microsoft/setup-msbuild@v1.1
with:
vs-version: '17.5'
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: |
mkdir _cmake_win64
- name: Configure CMake
working-directory: ./monica/_cmake_win64
run: |
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
- name: Create release
working-directory: ./monica
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create ${{ github.ref_name }} --draft --title="Monica ${{ github.ref_name }}"
- name: Upload executable
working-directory: ./monica
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release upload ${{ github.ref_name }} ${{ github.workspace }}/monica_win64_${{ github.ref_name }}.zip