Update Conda setup to version 4 in workflow files for improved compat… #205
This file contains hidden or 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: deploy-windows | |
| on: | |
| push: | |
| branches: | |
| - test_prerelease | |
| release: | |
| types: | |
| - published | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ windows-latest ] | |
| conda_platform: [ win-64 ] | |
| artifact_name: [ gemsgui-windows ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get version from CMakeLists.txt | |
| id: get_version | |
| uses: DarwinInnovation/cmake-project-version-action@v1.0 | |
| - name: Set deploy name | |
| id: strings | |
| shell: bash | |
| run: > | |
| echo "deploy-name=GEMS${{ steps.get_version.outputs.version }}" >> "$GITHUB_OUTPUT" | |
| - name: Set deploy dir | |
| id: strings2 | |
| shell: bash | |
| run: | | |
| echo "deploy-output-dir=${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}/Gems3-app" >> "$GITHUB_OUTPUT" | |
| echo "deploy-output-name=windows-${{ steps.strings.outputs.deploy-name }}.zip" >> "$GITHUB_OUTPUT" | |
| - name: Setup Conda | |
| uses: conda-incubator/setup-miniconda@v4 | |
| with: | |
| auto-activate: false | |
| activate-environment: base | |
| channels: conda-forge | |
| - name: Configuring Conda Environment | |
| run: | | |
| conda config --set always_yes yes --set changeps1 no | |
| conda config --add channels conda-forge | |
| conda install conda-devenv | |
| conda run -n base python -m conda_devenv | |
| - name: Building, Testing & Installing GEMSGUI (Windows) | |
| shell: cmd | |
| run: | | |
| call conda activate GEMSGUI || goto :eof | |
| cp "cmake/qt.conf" "C:\Miniconda\envs\GEMSGUI\Library\lib\qt6\bin" || goto :eof | |
| rem --- Build and install --- | |
| cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ steps.strings2.outputs.deploy-output-dir }} -A x64 -S . -B build || goto :eof | |
| cmake --build build --target install --config Release || goto :eof | |
| D:\a\GEMSGUI\GEMSGUI\build\Release\gems3helpconfig-qhp-generator.exe || goto :eof | |
| - name: Check deploy | |
| run: | | |
| conda activate GEMSGUI | |
| cd ${{ github.workspace }}/Resources/doc/html | |
| C:\Miniconda\envs\GEMSGUI\Library\lib\qt6\qhelpgenerator.exe gems3helpconfig.qhcp -o gems3help.qhc | |
| cp "gems3help.qhc" "${{ github.workspace }}/Resources/help" | |
| cp "gems3help.qch" "${{ github.workspace }}/Resources/help" | |
| cd ${{ github.workspace }}/Resources/help | |
| ls | |
| cp -r "${{ github.workspace }}/Resources" ${{ steps.strings2.outputs.deploy-output-dir }} | |
| cp "${{ github.workspace }}/Resources/rungems3.bat" "${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}" | |
| cp "${{ github.workspace }}/Resources/README-windows.txt" "${{ github.workspace }}/${{ steps.strings.outputs.deploy-name }}/README.txt" | |
| - name: Create zip archive (Windows) | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path "${{ steps.strings.outputs.deploy-name }}" -DestinationPath "${{ steps.strings2.outputs.deploy-output-name }}" | |
| - name: Upload zip archive | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-${{ steps.strings.outputs.deploy-name }} | |
| path: ${{ github.workspace }}/${{ steps.strings2.outputs.deploy-output-name }} | |
| - name: Upload release asset | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ github.workspace }}/${{ steps.strings2.outputs.deploy-output-name }} | |
| asset_name: ${{ steps.strings2.outputs.deploy-output-name }} | |
| asset_content_type: application/zip | |