Use my forked actions that actually builds python on mac instead of d… #61
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: Mac Releases | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILD_TYPE: Release | |
FC: gfortran-13 | |
SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk | |
Python_REQUIRED_VERSION: 3.12.2 | |
jobs: | |
mac_release: | |
runs-on: ${{ matrix.os }} | |
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: | |
macos_dev_target: [10.15, 11.6, 12.1, 13.0] | |
include: | |
- macos_dev_target: 10.15 | |
os: macos-11 | |
allow_failure: false | |
arch: x86_64 | |
- macos_dev_target: 11.6 | |
os: macos-11 | |
allow_failure: false | |
arch: x86_64 | |
- macos_dev_target: 12.1 | |
os: macos-12 | |
allow_failure: false | |
arch: x86_64 | |
- macos_dev_target: 13.0 | |
os: macos-14 | |
allow_failure: false | |
arch: arm64 | |
permissions: | |
# Needed permission to upload the release asset | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.Python_REQUIRED_VERSION }} | |
id: setup-python | |
uses: jmarrec/setup-python@v5 | |
with: | |
python-version: ${{ env.Python_REQUIRED_VERSION }} | |
- 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 "Using brew to install mactex and adding it to PATH" | |
brew update | |
brew install --cask mactex-no-gui | |
echo "/Library/TeX/texbin" >> $GITHUB_PATH | |
# The MACOSX_DEPLOYMENT_TARGET environment variable sets the default value for the CMAKE_OSX_DEPLOYMENT_TARGET variable. | |
# We use cmake commands to build some subprojects, so setting it globally | |
echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_dev_target }} >> $GITHUB_ENV | |
echo "Installing gcc@13 for gfortran support of -static-libquadmath" | |
brew list gcc@13 || brew install gcc@13 | |
which gfortran-13 || echo "FC=$(brew --prefix gcc@13)/bin/gfortran-13" >> $GITHUB_ENV | |
- name: Create Build Directory | |
run: cmake -E make_directory ./build/ | |
- name: Configure CMake | |
working-directory: ./build | |
shell: bash | |
run: | | |
cmake -DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE \ | |
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${{ matrix.macos_dev_target }} \ | |
-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 }}/x64/ \ | |
-DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON \ | |
-DDOCUMENTATION_BUILD:STRING="BuildWithAll" -DTEX_INTERACTION:STRING="batchmode" \ | |
-DENABLE_OPENMP:BOOL=OFF -DUSE_OpenMP:BOOL=OFF \ | |
../ | |
- name: Build Package | |
working-directory: ./build | |
shell: bash | |
run: cmake --build . --target package -j 3 | |
- name: otool the exes and libs | |
shell: bash | |
working-directory: ./build | |
run: | | |
set -x | |
cd _CPack_Packages/Darwin/TGZ/EnergyPlus*/ | |
otool -L ExpandObjects || true | |
otool -L ConvertInputFormat || true | |
otool -L energyplus || true | |
otool -L libenergyplusapi.dylib || true | |
otool -L PreProcess/IDFVersionUpdater/Transition-V23-1-0-to-V23-2-0 || true | |
otool -L PostProcess/ReadVarsESO || true | |
otool -L PostProcess/HVAC-Diagram || true | |
- name: Upload Tarball to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/EnergyPlus-*-${{ matrix.arch }}.tar.gz | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
- name: Upload DMG to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/EnergyPlus-*-${{ matrix.arch }}.dmg | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |