Merge branch 'main' of github.com:AquaticEcoDynamics/fv-aed #18
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
# This is a basic workflow to help you get started with Actions | |
name: Compile Mac, Ubuntu, Windows | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains three jobs called "macOS","Ubuntu", and "windows" | |
ubuntu20: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-20.04 | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Checkout submodules | |
run: | | |
git submodule update --init --recursive | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git pull | |
# Runs a single command using the runners shell | |
- name: Getting packages | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install devscripts | |
sudo apt-get install debhelper | |
- name: Install compiler | |
run: | | |
curl -SL --output l_fortran-compiler_p_2023.0.0.25394_offline.sh https://registrationcenter-download.intel.com/akdlm/irc_nas/19105/l_fortran-compiler_p_2023.0.0.25394_offline.sh | |
mkdir tmp | |
/bin/sh l_fortran-compiler_p_2023.0.0.25394_offline.sh -s -f tmp -a --silent --cli --action install --install-dir /opt/intel --eula accept | |
# Runs a set of commands using the runners shell | |
- name: compile libaed-fv | |
run: | | |
cd $GITHUB_WORKSPACE/fv-source | |
./build_aed-fv.sh | |
mkdir -p $GITHUB_WORKSPACE/binaries/ubuntu/20.04 | |
cp -r $GITHUB_WORKSPACE/fv-source/binaries/ubuntu/20.04/* $GITHUB_WORKSPACE/binaries/ubuntu/20.04/. | |
- name: update binaries and push to remote | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git pull | |
git add -A | |
git commit -m "Update Ubuntu 20.04 binaries" | |
git push | |
windows: | |
# The type of runner that the job will run on | |
runs-on: windows-2019 | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Checkout submodules | |
run: | | |
git submodule update --init --recursive | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git pull | |
- name: Install compiler | |
shell: bash | |
run: | | |
cd $GITHUB_WORKSPACE | |
# Although VS-2019 is already installed it's missing some parts needed, so we do it anyway | |
curl -SL --output vs_community.exe https://aka.ms/vs/16/release/vs_community.exe | |
./vs_community.exe --quiet --norestart --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended | |
# | |
curl -SL --ssl-no-revoke --output w_fortran-compiler_p_2023.0.0.25579_offline.exe https://registrationcenter-download.intel.com/akdlm/irc_nas/19107/w_fortran-compiler_p_2023.0.0.25579_offline.exe | |
mkdir tmp | |
./w_fortran-compiler_p_2023.0.0.25579_offline.exe -s -f tmp -a --silent --cli --action install --eula accept | |
- name: compile libaed-fv | |
shell: bash | |
run: | | |
# cd $GITHUB_WORKSPACE/fv-source | |
cd $GITHUB_WORKSPACE | |
cmd.exe /c 'fv-source\build_aed-fv.bat' | |
# cd $GITHUB_WORKSPACE/fv-source/libaed-fv/win | |
# cmd.exe /c build_fv.bat | |
echo '=========================' | |
cd $GITHUB_WORKSPACE/fv-source/libaed-fv/win/x64-Release | |
mkdir -p tuflowfv_external_wq | |
export VERSION=`grep FV_AED_VERS ../../src/fv_aed.F90 | grep define | cut -f2 -d\"` | |
mv tuflowfv_external_wq.??? tuflowfv_external_wq | |
powershell -Command "Compress-Archive -LiteralPath tuflowfv_external_wq -DestinationPath tuflowfv_external_wq_$VERSION.zip" | |
echo | |
if [ ! -d $GITHUB_WORKSPACE/binaries/windows ] ; then | |
mkdir -p $GITHUB_WORKSPACE/binaries/windows | |
fi | |
cp tuflowfv_external_wq_$VERSION.zip $GITHUB_WORKSPACE/binaries/windows | |
- name: update binaries and push to remote | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git pull | |
git add -A | |
git commit -m "Update Windows binaries" | |
git push |