Skip to content

Build CEA Setup

Build CEA Setup #93

Workflow file for this run

name: Build CEA Windows setup
on:
workflow_dispatch
jobs:
build_win_setup:
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v3
- name: Install conda environment from environment.yml
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true
environment-name: cea
init-shell: bash powershell
- name: Install CEA to conda environment
shell: bash -l {0}
run: pip install .
- name: Install conda-pack
run: micromamba create -n conda-pack conda-pack
- name: Pack conda environment
shell: bash -l {0}
run: |
micromamba activate conda-pack
conda-pack -p $MAMBA_ROOT_PREFIX/envs/cea -o $GITHUB_WORKSPACE/cea.tar.gz --n-threads -1
- name: Extract tar
shell: bash
run: |
mkdir -p $GITHUB_WORKSPACE/setup/Dependencies/Python
cd $GITHUB_WORKSPACE/setup/Dependencies/Python
tar -xzf $GITHUB_WORKSPACE/cea.tar.gz --force-local
- name: Create sdist of CEA
shell: bash
run: |
CEA_VERSION=$(python -c "import cea; print(cea.__version__)")
python setup.py sdist
mv dist/cityenergyanalyst-$CEA_VERSION.tar.gz setup/Dependencies/cityenergyanalyst.tar.gz
- uses: actions/checkout@v3
with:
path: gui
repository: architecture-building-systems/CityEnergyAnalyst-GUI
- name: Cache GUI
id: cache-gui
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/setup/CityEnergyAnalyst-GUI-win32-x64
key: ${{ runner.os }}-${{ hashFiles('gui/src', 'gui/yarn.lock') }}-gui-setup
- name: Package CEA GUI
if: steps.cache-gui.outputs.cache-hit != 'true'
shell: bash
run: |
cd $GITHUB_WORKSPACE/gui
yarn
yarn package
mv out/CityEnergyAnalyst-GUI-win32-x64 $GITHUB_WORKSPACE/setup/CityEnergyAnalyst-GUI-win32-x64
- name: Install setup plugin
shell: bash
run: |
cd "C:\Program Files (x86)\NSIS\Plugins\x86-unicode"
curl -o Nsis7z.7z https://nsis.sourceforge.io/mediawiki/images/6/69/Nsis7z_19.00.7z
7z e Nsis7z.7z Plugins/x86-unicode/nsis7z.dll
- name: Make setup
shell: bash
run: |
mkdir -p $GITHUB_WORKSPACE/setup/Output
makensis $GITHUB_WORKSPACE/setup/cityenergyanalyst.nsi
- name: Upload setup
uses: actions/upload-artifact@v3
with:
name: setup
path: ${{ github.workspace }}\setup\Output