Skip to content

Commit

Permalink
Merge pull request #139 from NREL/energyplus-action
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewSteen authored Jan 30, 2024
2 parents 8547b99 + 4db6a6a commit 9a94dcc
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/energyplus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: energyplus

on: workflow_dispatch

env:
EP_VER: v23.2.0
BUILD_TYPE: Release
Python_REQUIRED_VERSION: 3.8
# the following variables customize the build for revit
CMAKE_GENERATOR_PLATFORM: x64
CMAKE_LINK_WITH_PYTHON: OFF
CMAKE_ENABLE_HARDENED_RUNTIME: OFF
PACKAGE_ARCH: x86_64

jobs:
# https://github.com/NREL/EnergyPlus/blob/develop/.github/workflows/windows_release.yml
windows_release:
runs-on: windows-2019

permissions:
# Needed permission to upload the release asset
contents: write

steps:
- uses: actions/checkout@v3

- name: checkout NREL/EnergyPlus
uses: actions/checkout@v3
with:
repository: NREL/EnergyPlus
ref: ${{ env.EP_VER }}

- name: Set up Python ${{ env.Python_REQUIRED_VERSION }}
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ env.Python_REQUIRED_VERSION }}

- name: Setup QtIFW 4.x
uses: jmarrec/setup-qtifw@v1
with:
qtifw-version: '4.x'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install aqtinstall
- 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 ${{ env.CMAKE_GENERATOR_PLATFORM }} \
-DLINK_WITH_PYTHON:BOOL=${{ env.CMAKE_LINK_WITH_PYTHON }} -DPython_REQUIRED_VERSION:STRING=${{ steps.setup-python.outputs.python-version }} \
-DPython_ROOT_DIR:PATH=$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/${{ env.CMAKE_GENERATOR_PLATFORM }}/ \
-DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON \
-DENABLE_HARDENED_RUNTIME:BOOL=${{ env.CMAKE_ENABLE_HARDENED_RUNTIME }} \
-DDOCUMENTATION_BUILD:STRING="DoNotBuild" \
../
- name: Build Package
working-directory: ./build
shell: bash
run: cmake --build . --target package -j 2 --config $BUILD_TYPE

# use github's action instead of EnergyPlus' https://github.com/svenstaro/upload-release-action
- name: upload
uses: actions/upload-artifact@v3
with:
path: build/EnergyPlus-*-Windows-${{ env.PACKAGE_ARCH }}.zip

- name: dnload
uses: actions/download-artifact@v3

# use this action per archived https://github.com/actions/upload-release-asset
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/EnergyPlus-*-Windows-${{ env.PACKAGE_ARCH }}.zip

0 comments on commit 9a94dcc

Please sign in to comment.