name: Build CEA Windows setup

on:
  workflow_dispatch:
    inputs:
      version:
        required: true
        type: string

jobs:
  build:
    runs-on: "windows-latest"
        
    steps:
      - uses: actions/checkout@v3

      - name: Set up Python 3.8
        uses: actions/setup-python@v4
        with:
          python-version: 3.8
          cache: 'pip'

      - name: Get exe locations
        id: exe_locations
        run: |
          "yarn=$((get-command yarn).Path)" >> $env:GITHUB_OUTPUT
          "nsis=$((get-command makensis).Path)" >> $env:GITHUB_OUTPUT

      - name: Install CEA
        shell: powershell
        run: pip install .
      
      - name: Clone GUI repo
        uses: actions/checkout@v3
        with:
          repository: architecture-building-systems/CityEnergyAnalyst-GUI
          path: GUI
      
      - name: Set cea config
        shell: powershell
        run: >
          cea-config build
          --yarn "${{ steps.exe_locations.outputs.yarn }}"
          --nsis "${{ steps.exe_locations.outputs.nsis }}"
          --gui $env:GITHUB_WORKSPACE\GUI
          --conda $env:CONDA\bin\conda
        
      - name: Build setup
        shell: powershell
        run: cea-dev build
      
      - name: Upload setup
        uses: actions/upload-artifact@v3
        with:
          name: setup
          path: $GITHUB_WORKSPACE\setup\Output

name: Build CEA Windows setup

on:
  workflow_dispatch:
    inputs:
      version:
        required: true
        type: string

jobs:
  build:
    runs-on: "windows-latest"
        
    steps:
      - uses: actions/checkout@v3

      - name: Set up Python 3.8
        uses: actions/setup-python@v4
        with:
          python-version: 3.8
          cache: 'pip'
          cache-dependency-path: |
            setup.py

      - name: Get exe locations
        id: exe_locations
        run: |
          "yarn=$((get-command yarn).Path)" >> $env:GITHUB_OUTPUT
          "nsis=$((get-command makensis).Path)" >> $env:GITHUB_OUTPUT

      - name: Install CEA
        shell: powershell
        run: pip install .
      
      - name: Clone GUI repo
        uses: actions/checkout@v3
        with:
          repository: architecture-building-systems/CityEnergyAnalyst-GUI
          path: GUI
      
      - name: Set cea config
        shell: powershell
        run: >
          cea-config build
          --yarn "${{ steps.exe_locations.outputs.yarn }}"
          --nsis "${{ steps.exe_locations.outputs.nsis }}"
          --gui $env:GITHUB_WORKSPACE\GUI
          --conda $env:CONDA\bin\conda
        
      - name: Build setup
        shell: powershell
        run: cea-dev build
      
      - name: Upload setup
        uses: actions/upload-artifact@v3
        with:
          name: setup
          path: $GITHUB_WORKSPACE\setup\Output

Fix pip cache dep path
Fix pip cache dep path