Use my forked actions that actually builds python on mac instead of d… #75
Workflow file for this run
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
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 | |
Python_REQUIRED_VERSION: 3.12.2 | |
jobs: | |
windows_release: | |
runs-on: windows-2019 | |
# to move to windows-2022, just make sure to set the Visual Studio generator build to "17 2022" | |
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: | |
name: [x64, x64_hardened] # removed x86 because it won't build packages now | |
include: | |
- name: x64 | |
arch: x64 | |
allow_failure: false | |
vs-generator: x64 | |
package-arch: x86_64 | |
enable_hardened_runtime: OFF | |
# - name: x86 | |
# arch: x86 | |
# allow_failure: false | |
# vs-generator: Win32 | |
# package-arch: i386 | |
# enable_hardened_runtime: OFF | |
- name: x64_hardened | |
arch: x64 | |
allow_failure: false | |
vs-generator: x64 | |
package-arch: x86_64-HardenedRuntime | |
enable_hardened_runtime: ON | |
permissions: | |
# Needed permission to upload the release asset | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.Python_REQUIRED_VERSION }} | |
uses: jmarrec/setup-python@v5 | |
id: setup-python | |
with: | |
python-version: ${{ env.Python_REQUIRED_VERSION }} | |
architecture: ${{ matrix.arch }} | |
- name: Setup QtIFW 4.x | |
uses: jmarrec/setup-qtifw@v1 | |
with: | |
qtifw-version: '4.6.1' | |
- 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-5.5.0%2B1763023-x64.zip | |
unzip miktexsetup-5.5.0%2B1763023-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=essential \ | |
download | |
echo "Installing from the local package directory previously set up" | |
./miktexsetup_standalone --verbose \ | |
--local-package-repository=C:/ProgramData/MiKTeX-Repo \ | |
--package-set=essential \ | |
--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 | |
# This will install all required packages and does that in a single thread. So later in cmake we can safely run in parallel | |
- name: Install required packages by building the Test document | |
shell: bash | |
working-directory: ./doc/ | |
run: | | |
# It shaves about 1min40s to preinstall from the .lst so do it first | |
mpm --verbose --admin --require=@energyplus_packages_windows.lst | |
cd test/ | |
xelatex dependencies.tex | |
- 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:BOOL=ON -DPython_REQUIRED_VERSION:STRING=${{ steps.setup-python.outputs.python-version }} \ | |
-DPython_ROOT_DIR:PATH=$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/${{ matrix.arch }}/ \ | |
-DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON \ | |
-DENABLE_HARDENED_RUNTIME:BOOL=${{ matrix.enable_hardened_runtime }} \ | |
-DDOCUMENTATION_BUILD:STRING="BuildWithAll" -DTEX_INTERACTION:STRING="batchmode" \ | |
../ | |
- name: Build Package | |
working-directory: ./build | |
shell: bash | |
run: cmake --build . --target package -j 4 --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 |