|
| 1 | +name: Releases |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +env: |
| 9 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 10 | + BUILD_TYPE: Release |
| 11 | + |
| 12 | +jobs: |
| 13 | + release: |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + continue-on-error: ${{ matrix.allow_failure }} |
| 16 | + strategy: |
| 17 | + # fail-fast: Default is true, switch to false to allow one platform to fail and still run others |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + build_name: [Windows_x64, Windows_x86, Ubuntu_18.04, Ubuntu_20.04, macOS_10.15] |
| 21 | + include: |
| 22 | + - build_name: Windows_x64 |
| 23 | + os: windows-2019 |
| 24 | + arch: x64 |
| 25 | + allow_failure: false |
| 26 | + CMAKE_GENERATOR_PLATFORM: x64 |
| 27 | + package-arch: x86_64 |
| 28 | + BINARY_EXT: exe |
| 29 | + COMPRESSED_EXT: zip |
| 30 | + QT_OS_NAME: windows |
| 31 | + - build_name: Windows_x86 |
| 32 | + os: windows-2019 |
| 33 | + arch: x86 |
| 34 | + allow_failure: false |
| 35 | + CMAKE_GENERATOR_PLATFORM: Win32 |
| 36 | + package-arch: i386 |
| 37 | + BINARY_EXT: exe |
| 38 | + COMPRESSED_EXT: zip |
| 39 | + QT_OS_NAME: windows |
| 40 | + - build_name: Ubuntu_18.04 |
| 41 | + os: ubuntu-18.04 |
| 42 | + arch: x64 |
| 43 | + allow_failure: false |
| 44 | + package-arch: x86_64 |
| 45 | + BINARY_EXT: run |
| 46 | + COMPRESSED_EXT: tar.gz |
| 47 | + SH_EXT: sh |
| 48 | + QT_OS_NAME: linux |
| 49 | + - build_name: Ubuntu_20.04 |
| 50 | + os: ubuntu-20.04 |
| 51 | + arch: x64 |
| 52 | + allow_failure: false |
| 53 | + package-arch: x86_64 |
| 54 | + BINARY_EXT: run |
| 55 | + COMPRESSED_EXT: tar.gz |
| 56 | + SH_EXT: sh |
| 57 | + QT_OS_NAME: linux |
| 58 | + - build_name: macOS_10.15 |
| 59 | + os: macos-10.15 |
| 60 | + arch: x64 |
| 61 | + allow_failure: false |
| 62 | + package-arch: x86_64 |
| 63 | + BINARY_EXT: dmg |
| 64 | + COMPRESSED_EXT: tar.gz |
| 65 | + SH_EXT: sh |
| 66 | + QT_OS_NAME: mac |
| 67 | + MACOSX_DEPLOYMENT_TARGET: 10.15 |
| 68 | + SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk |
| 69 | + |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v2 |
| 72 | + |
| 73 | + - name: Set up Python 3.7 |
| 74 | + uses: actions/setup-python@v2 |
| 75 | + with: |
| 76 | + python-version: 3.7 |
| 77 | + architecture: ${{ matrix.arch }} |
| 78 | + |
| 79 | + - name: Install Python dependencies |
| 80 | + run: | |
| 81 | + python -m pip install --upgrade pip |
| 82 | + pip install aqtinstall |
| 83 | +
|
| 84 | + - name: Install System dependencies and LaTeX |
| 85 | + shell: bash |
| 86 | + run: | |
| 87 | + set -x |
| 88 | + if [ "$RUNNER_OS" == "Linux" ]; then |
| 89 | + echo "Using Apt to install dependencies" |
| 90 | + sudo apt update |
| 91 | + sudo apt install texlive texlive-xetex texlive-science libxkbcommon-x11-0 xorg-dev libgl1-mesa-dev |
| 92 | +
|
| 93 | + elif [ "$RUNNER_OS" == "macOS" ]; then |
| 94 | + echo "Setting up MACOSX_DEPLOYMENT_TARGET and SDKROOT" |
| 95 | + echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.MACOSX_DEPLOYMENT_TARGET }} >> $GITHUB_ENV |
| 96 | + echo SDKROOT=${{ matrix.SDKROOT }} >> $GITHUB_ENV |
| 97 | + # The MACOSX_DEPLOYMENT_TARGET environment variable sets the default value for the CMAKE_OSX_DEPLOYMENT_TARGET variable. |
| 98 | + # echo CMAKE_MACOSX_DEPLOYMENT_TARGET='-DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET' >> $GITHUB_ENV |
| 99 | +
|
| 100 | + echo "Using brew to install mactex and adding it to PATH" |
| 101 | + brew cask install mactex |
| 102 | + echo "/Library/TeX/texbin" >> $GITHUB_PATH |
| 103 | +
|
| 104 | + echo "Setting FC (fortran compiler)" |
| 105 | + echo FC=/usr/local/bin/gfortran-9 >> $GITHUB_ENV |
| 106 | +
|
| 107 | + elif [ "$RUNNER_OS" == "Windows" ]; then |
| 108 | +
|
| 109 | + echo "Setting CMAKE_GENERATOR options equivalent to ='-G \"Visual Studio 16 2019\" -A ${{ matrix.CMAKE_GENERATOR_PLATFORM }}'" |
| 110 | + echo CMAKE_GENERATOR='Visual Studio 16 2019' >> $GITHUB_ENV |
| 111 | + echo CMAKE_GENERATOR_PLATFORM=${{ matrix.CMAKE_GENERATOR_PLATFORM }} >> $GITHUB_ENV |
| 112 | +
|
| 113 | + # echo FC="C:/msys64/mingw64/bin/x86_64-w64-mingw32-gfortran.exe" >> $GITHUB_ENV |
| 114 | +
|
| 115 | + echo "Downloading MiKTeX CLI installer" |
| 116 | + # We download from a specific miror already |
| 117 | + curl -L -O https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-4.0-x64.zip |
| 118 | + unzip miktexsetup-4.0-x64.zip |
| 119 | +
|
| 120 | + echo "Setting up the local package directory via download" |
| 121 | + ./miktexsetup --verbose \ |
| 122 | + --local-package-repository=C:/ProgramData/MiKTeX-Repo \ |
| 123 | + --remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \ |
| 124 | + --package-set=basic \ |
| 125 | + download |
| 126 | +
|
| 127 | + echo "Installing from the local package directory previously set up" |
| 128 | + ./miktexsetup --verbose \ |
| 129 | + --local-package-repository=C:/ProgramData/MiKTeX-Repo \ |
| 130 | + --package-set=basic \ |
| 131 | + --shared \ |
| 132 | + install |
| 133 | +
|
| 134 | + echo "Adding MiKTeX bin folder to PATH and to GITHUB_PATH" |
| 135 | + echo "C:/Program Files/MiKTeX/miktex/bin/x64/" >> $GITHUB_PATH |
| 136 | + export PATH="/c/Program Files/MiKTeX/miktex/bin/x64/:$PATH" |
| 137 | +
|
| 138 | + echo "Configuring MiKTeX to install missing packages on the fly" |
| 139 | + initexmf --admin --verbose --set-config-value='[MPM]AutoInstall=1' |
| 140 | +
|
| 141 | + echo "Configure default mirror for packages" |
| 142 | + mpm --admin --set-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" |
| 143 | + # Avoid annoying warning: "xelatex: major issue: So far, you have not checked for updates as a MiKTeX user." |
| 144 | + mpm --find-updates |
| 145 | + mpm --admin --find-updates |
| 146 | + fi; |
| 147 | +
|
| 148 | + #- name: Build Test Document (will install missing packages) |
| 149 | + #working-directory: ./doc/test |
| 150 | + #shell: bash |
| 151 | + #run: | |
| 152 | + #set -x |
| 153 | + #xelatex dependencies.tex |
| 154 | + |
| 155 | + - name: Install IFW |
| 156 | + shell: bash |
| 157 | + run: | |
| 158 | + set -x |
| 159 | + out_dir=${{ runner.workspace }}/Qt |
| 160 | + if [ "$RUNNER_OS" == "Windows" ]; then |
| 161 | + out_dir="C:/Qt" |
| 162 | + fi; |
| 163 | +
|
| 164 | + aqt tool ${{ matrix.QT_OS_NAME }} tools_ifw 3.2.2 qt.tools.ifw.32 --outputdir="$out_dir" |
| 165 | + echo "$out_dir/Tools/QtInstallerFramework/3.2/bin" >> $GITHUB_PATH |
| 166 | +
|
| 167 | + - name: Create Build Directory |
| 168 | + run: cmake -E make_directory ./build/ |
| 169 | + |
| 170 | + - name: Configure CMake |
| 171 | + working-directory: ./build |
| 172 | + shell: bash |
| 173 | + run: | |
| 174 | + set -x |
| 175 | + cmake -DLINK_WITH_PYTHON=ON -DBUILD_FORTRAN=ON -DBUILD_PACKAGE:BOOL=ON \ |
| 176 | + -DDOCUMENTATION_BUILD="BuildWithAll" -DTEX_INTERACTION="batchmode" \ |
| 177 | + ../ |
| 178 | +
|
| 179 | + - name: Build Package |
| 180 | + working-directory: ./build |
| 181 | + shell: bash |
| 182 | + run: cmake --build . --target package -j 2 --config $BUILD_TYPE |
| 183 | + |
| 184 | + - name: Upload Zip to release |
| 185 | + uses: svenstaro/upload-release-action@v2 |
| 186 | + with: |
| 187 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 188 | + file: build/EnergyPlus-*-${{ matrix.package-arch }}.${{ matrix.COMPRESSED_EXT }} |
| 189 | + tag: ${{ github.ref }} |
| 190 | + overwrite: true |
| 191 | + file_glob: true |
| 192 | + |
| 193 | + - name: Upload IFW to release |
| 194 | + uses: svenstaro/upload-release-action@v2 |
| 195 | + with: |
| 196 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 197 | + file: build/EnergyPlus-*-${{ matrix.package-arch }}.${{ matrix.BINARY_EXT }} |
| 198 | + tag: ${{ github.ref }} |
| 199 | + overwrite: true |
| 200 | + file_glob: true |
| 201 | + |
| 202 | + - name: Upload SH to release |
| 203 | + if: runner.os == 'Linux' |
| 204 | + uses: svenstaro/upload-release-action@v2 |
| 205 | + with: |
| 206 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 207 | + file: build/EnergyPlus-*-${{ matrix.package-arch }}.${{ matrix.SH_EXT }} |
| 208 | + tag: ${{ github.ref }} |
| 209 | + overwrite: true |
| 210 | + file_glob: true |
| 211 | + |
0 commit comments