Skip to content

Tag Created Workflow #33

Tag Created Workflow

Tag Created Workflow #33

Workflow file for this run

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: Checkout vcpkg
uses: actions/checkout@v3
with:
repository: microsoft/vcpkg
ref: master
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 }}/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
- 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