forked from NREL/EnergyPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (106 loc) · 4.09 KB
/
windows_release.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
name: Windows Releases
on:
push:
tags:
- '*'
env:
CMAKE_Fortran_COMPILER: "/c/msys64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_TYPE: Release
jobs:
windows_release:
runs-on: windows-2019
continue-on-error: ${{ matrix.allow_failure }}
strategy:
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
fail-fast: false
matrix:
arch: [x64, x86]
include:
- arch: x64
allow_failure: false
vs-generator: x64
package-arch: x86_64
- arch: x86
allow_failure: false
vs-generator: Win32
package-arch: i386
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: ${{ matrix.arch }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install aqtinstall
- name: Install System dependencies and LaTeX
shell: bash
run: |
set -x
echo "Downloading MiKTeX CLI installer"
# We download from a specific miror already # TODO: Should store this setup package somewhere ourselves
curl -L -O https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-4.1-x64.zip
unzip miktexsetup-4.1-x64.zip
echo "Setting up the local package directory via download"
./miktexsetup_standalone --verbose \
--local-package-repository=C:/ProgramData/MiKTeX-Repo \
--remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \
--package-set=basic \
download
echo "Installing from the local package directory previously set up"
./miktexsetup_standalone --verbose \
--local-package-repository=C:/ProgramData/MiKTeX-Repo \
--package-set=basic \
--shared \
install
echo "Adding MiKTeX bin folder to PATH and to GITHUB_PATH"
echo "C:/Program Files/MiKTeX/miktex/bin/x64/" >> $GITHUB_PATH
export PATH="/c/Program Files/MiKTeX/miktex/bin/x64/:$PATH"
echo "Configuring MiKTeX to install missing packages on the fly"
initexmf --admin --verbose --set-config-value='[MPM]AutoInstall=1'
echo "Configure default mirror for packages"
mpm --admin --set-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/"
# Avoid annoying warning: "xelatex: major issue: So far, you have not checked for updates as a MiKTeX user."
mpm --find-updates
mpm --admin --find-updates
- name: Install IFW
shell: bash
run: |
set -x
out_dir="C:/Qt"
aqt tool windows tools_ifw 4.0 qt.tools.ifw.40 --outputdir="$out_dir"
echo "$out_dir/Tools/QtInstallerFramework/4.0/bin" >> $GITHUB_PATH
- name: Create Build Directory
run: cmake -E make_directory ./build/
- name: Configure CMake
working-directory: ./build
shell: bash
run: |
set -x
cmake -G "Visual Studio 16 2019" -A ${{ matrix.vs-generator }} \
-DLINK_WITH_PYTHON=ON -DBUILD_FORTRAN=ON -DBUILD_PACKAGE:BOOL=ON \
-DDOCUMENTATION_BUILD="BuildWithAll" -DTEX_INTERACTION="batchmode" \
../
- name: Build Package
working-directory: ./build
shell: bash
run: cmake --build . --target package -j 2 --config $BUILD_TYPE
- name: Upload Zip to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/EnergyPlus-*-Windows-${{ matrix.package-arch }}.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload IFW to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/EnergyPlus-*-Windows-${{ matrix.package-arch }}.exe
tag: ${{ github.ref }}
overwrite: true
file_glob: true