-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from odav/main
Aggregated Fixes and Updates SOC and build mgmt
- Loading branch information
Showing
183 changed files
with
2,859 additions
and
2,874 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,16 +9,139 @@ on: | |
- '*.*.*' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
rev: | ||
description: 'tag, branch, or SHA to check out' | ||
required: true | ||
default: 'develop' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
pull-requests: write | ||
|
||
|
||
|
||
jobs: | ||
build: | ||
|
||
# Get the version from tag | ||
version: | ||
name: Version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: '${{ github.event.inputs.rev }}' | ||
fetch-tags: true | ||
fetch-depth: 0 | ||
- name: Get SWAT+ version | ||
id: get_version | ||
run: | | ||
V=`git describe --tags` | ||
echo $V | ||
echo $V >v.txt | ||
cat v.txt | ||
echo ${{ github.event.release.tag_name }} | ||
echo ${GITHUB_REF#refs/*/} | ||
- name: upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release_tag | ||
path: v.txt | ||
|
||
##### Build swat with GNU | ||
build-gnu: | ||
runs-on: ${{ matrix.os }} | ||
if: endsWith(github.event.base_ref, 'main') == true | ||
needs: | ||
- version | ||
#if: endsWith(github.event.base_ref, 'main') == true | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
toolchain: | ||
- {compiler: gcc, version: 13} | ||
|
||
steps: | ||
- name: Install Compiler | ||
uses: fortran-lang/setup-fortran@v1 | ||
id: setup-fortran | ||
with: | ||
compiler: ${{ matrix.toolchain.compiler }} | ||
version: ${{ matrix.toolchain.version }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build SWAT+ | ||
id: build_exe | ||
run: | | ||
echo ${{ env.FC }} | ||
cmake --version | ||
RELEASE_VERSION=${GITHUB_REF#refs/*/} | ||
os="$RUNNER_OS" | ||
e="build/swatplus-*" | ||
gen="Unix" | ||
if [ "$RUNNER_OS" == "Windows" ]; then | ||
e="build/swatplus-*.exe" | ||
gen="MinGW" | ||
fi | ||
# generate | ||
cmake -B build -G "${gen} Makefiles" \ | ||
-D CMAKE_Fortran_COMPILER=${{ env.FC }} \ | ||
-D TAG=$RELEASE_VERSION \ | ||
-D CMAKE_BUILD_TYPE=Release | ||
# build | ||
cmake --build build --parallel 4 | ||
exebase=`basename -s .exe build/swatplus-*` | ||
exez="${exebase}.zip" | ||
exe=`ls $e` | ||
echo $exe | ||
echo $exez | ||
echo $os | ||
echo "exe=$exe" >> $GITHUB_OUTPUT | ||
echo "exez=$exez" >> $GITHUB_OUTPUT | ||
echo "os=$os" >> $GITHUB_OUTPUT | ||
ls -hl build/swatplus-* | ||
file build/swatplus-* | ||
if [ "$RUNNER_OS" != "Windows" ]; then | ||
(cd build && zip ../$exez swatplus-*) | ||
fi | ||
shell: bash | ||
|
||
- name: zip | ||
if: matrix.os == 'windows-latest' | ||
uses: vimtor/[email protected] | ||
with: | ||
files: ${{ steps.build_exe.outputs.exe }} | ||
dest: ${{ steps.build_exe.outputs.exez }} | ||
|
||
- name: upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gnu-${{ steps.build_exe.outputs.os }} | ||
path: ${{ steps.build_exe.outputs.exez }} | ||
|
||
|
||
##### Build with Intel (ifx. ifort) | ||
|
||
build-intel: | ||
runs-on: ${{ matrix.os }} | ||
needs: | ||
- version | ||
# if: endsWith(github.event.base_ref, 'main') == true | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -38,7 +161,8 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
# with: | ||
with: | ||
ref: '${{ github.event.inputs.rev }}' | ||
# fetch-tags: true | ||
# fetch-depth: 0 | ||
|
||
|
@@ -49,13 +173,19 @@ jobs: | |
compiler: ${{ matrix.toolchain.compiler }} | ||
version: ${{ matrix.toolchain.version }} | ||
|
||
- name: Download version | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release_tag | ||
|
||
- name: Build SWAT+ | ||
id: build_exe | ||
run: | | ||
echo ${{ env.FC }} | ||
cmake --version | ||
RELEASE_VERSION=${GITHUB_REF#refs/*/} | ||
# RELEASE_VERSION=${GITHUB_REF#refs/*/} | ||
RELEASE_VERSION=`cat v.txt` | ||
os="$RUNNER_OS" | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
|
@@ -83,7 +213,7 @@ jobs: | |
fi | ||
# compile | ||
cmake --build build | ||
cmake --build build --parallel 4 | ||
exebase=`basename -s .exe build/swatplus-*` | ||
exez="${exebase}.zip" | ||
|
@@ -114,48 +244,71 @@ jobs: | |
dest: ${{ steps.build_exe.outputs.exez }} | ||
|
||
- name: upload | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sp-${{ steps.build_exe.outputs.os }} | ||
name: intel-${{ steps.build_exe.outputs.os }} | ||
path: ${{ steps.build_exe.outputs.exez }} | ||
|
||
|
||
##### Create a new release with all zip files | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
needs: [ build-gnu, build-intel ] | ||
|
||
steps: | ||
- name: Download Linux | ||
uses: actions/download-artifact@v2 | ||
- name: Download GNU Linux | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: gnu-Linux | ||
|
||
- name: Download GNU Windows | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: sp-Linux | ||
name: gnu-Windows | ||
|
||
- name: Download Windows | ||
uses: actions/download-artifact@v2 | ||
- name: Download GNU macOS | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: sp-Windows | ||
name: gnu-macOS | ||
|
||
- name: Download macOS | ||
uses: actions/download-artifact@v2 | ||
- name: Download Intel Linux | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: sp-macOS | ||
name: intel-Linux | ||
|
||
- name: Download Intel Windows | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: intel-Windows | ||
|
||
- name: Download Intel macOS | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: intel-macOS | ||
|
||
- name: Download version | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release_tag | ||
|
||
- name: Read version | ||
id: read_ver | ||
run: | | ||
RELEASE_VERSION=`cat v.txt` | ||
echo "rv=$RELEASE_VERSION" >> $GITHUB_OUTPUT | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
token: ${{ github.token }} | ||
tag_name: ${{ github.event.release.tag_name }} | ||
prerelease: false | ||
# tag_name: ${{ github.event.release.tag_name }} | ||
prerelease: true | ||
draft: false | ||
name: ${{ github.event.release.tag_name }} | ||
# name: ${{ github.event.release.tag_name }} | ||
name: ${{ steps.read_ver.outputs.rv }} | ||
files: swatplus-* | ||
generate_release_notes: true | ||
body: | | ||
<details> | ||
<summary>Autogenerated Changelog</summary> | ||
... changelog ... | ||
</details> | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,5 @@ CMakeCache.txt | |
Resources/R* | ||
src/main.f90 | ||
ford.md | ||
/.vs/SWAT_PLUS_DEV | ||
/.vs/SWAT_PLUS_DEV | ||
/.vscode |
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
Oops, something went wrong.