Skip to content

updated links

updated links #56

Workflow file for this run

# SWAT+ CI for GitHub, O. David, 2024, LGPL 2.1
name: Build/Release SWAT+
on:
push:
tags:
- '*.*'
- '*.*.*'
workflow_dispatch:
permissions:
contents: write
packages: write
pull-requests: write
jobs:
build:
runs-on: ${{ matrix.os }}
if: endsWith(github.event.base_ref, 'main') == true
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain:
- {compiler: intel, version: '2024.1'}
- {compiler: intel-classic, version: '2021.9'}
exclude:
- os: macos-latest
toolchain: {compiler: intel, version: '2024.1'}
- os: windows-latest
toolchain: {compiler: intel-classic, version: '2021.9'}
- os: ubuntu-latest
toolchain: {compiler: intel-classic, version: '2021.9'}
steps:
- name: Checkout
uses: actions/checkout@v4
# with:
# fetch-tags: true
# fetch-depth: 0
- name: Install Compiler
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- name: Build SWAT+
id: build_exe
run: |
echo ${{ env.FC }}
cmake --version
RELEASE_VERSION=${GITHUB_REF#refs/*/}
os="$RUNNER_OS"
if [ "$RUNNER_OS" == "Linux" ]; then
cmake -B build \
-D CMAKE_Fortran_COMPILER=${{ env.FC }} \
-D TAG=$RELEASE_VERSION
e="build/swatplus-*"
elif [ "$RUNNER_OS" == "Windows" ]; then
cmake -B build -G "MinGW Makefiles" \
-D CMAKE_Fortran_COMPILER="C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\bin\${{ env.FC }}.exe" \
-D TAG=$RELEASE_VERSION
e="build/swatplus-*.exe"
elif [ "$RUNNER_OS" == "macOS" ]; then
cmake -B build \
-D CMAKE_Fortran_COMPILER=${{ env.FC }} \
-D TAG=$RELEASE_VERSION \
-D CMAKE_APPLE_SILICON_PROCESSOR="x86_64"
e="build/swatplus-*"
else
echo "$RUNNER_OS not supported."
exit 1
fi
# compile
cmake --build build
exe=`ls $e`
echo $exe
echo $os
echo "exe=$exe" >> $GITHUB_OUTPUT
echo "os=$os" >> $GITHUB_OUTPUT
ls -hl build/swatplus-*
file build/swatplus-*
shell: bash
- name: upload
uses: actions/upload-artifact@v2
with:
name: sp-${{ steps.build_exe.outputs.os }}
path: ${{ steps.build_exe.outputs.exe }}
release:
name: Release
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download Linux
uses: actions/download-artifact@v2
with:
name: sp-Linux
- name: Download Windows
uses: actions/download-artifact@v2
with:
name: sp-Windows
- name: Download macOS
uses: actions/download-artifact@v2
with:
name: sp-macOS
- name: Release
uses: softprops/action-gh-release@v2
with:
token: ${{ github.token }}
tag_name: ${{ github.event.release.tag_name }}
prerelease: false
draft: false
name: ${{ github.event.release.tag_name }}
files: swatplus-*
generate_release_notes: true
body: |
<details>
<summary>Autogenerated Changelog</summary>
... changelog ...
</details>