-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·125 lines (108 loc) · 5.13 KB
/
compile.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
# 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@v4
- 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@v4
- 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