馃敄 Set version to 1.5 #68
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: Build HTCC | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.github/workflows/pages.yml' | |
| pull_request: | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.github/workflows/pages.yml' | |
| jobs: | |
| build: | |
| name: ${{matrix.preset}} | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| preset: | |
| - Debug - default | |
| - Debug - clang-cl | |
| - Release | |
| env: | |
| VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/.vcpkg-binary-cache | |
| steps: | |
| - name: Set up visual studio environment | |
| shell: pwsh | |
| run: | | |
| $VSRoot = $( | |
| vswhere ` | |
| -latest ` | |
| -products * ` | |
| -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ` | |
| -property installationPath) | |
| cmd /c "`"${VSRoot}/VC/Auxiliary/Build/vcvarsall.bat`" x64&set" ` | |
| | Where-Object { $_ -like '*=*' } ` | |
| | Out-File -Encoding utf8 -Append $Env:GITHUB_ENV | |
| - uses: actions/checkout@v6 | |
| with: | |
| path: source | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Make build directory | |
| run: cmake -E make_directory build | |
| - name: Setup vcpkg binary cache | |
| uses: actions/cache@v4 | |
| with: | |
| key: ${{matrix.preset}}-${{hashFiles('source/vcpkg.json', 'source/vcpkg-configuration.json')}} | |
| path: ${{env.VCPKG_DEFAULT_BINARY_CACHE}} | |
| - name: Configure | |
| id: configure | |
| working-directory: build | |
| shell: pwsh | |
| run: | | |
| cmake -E make_directory "${{env.VCPKG_DEFAULT_BINARY_CACHE}}" | |
| $args = @() | |
| if ("${{github.ref_type}}" -eq "tag") { | |
| $args += "-DIS_TAGGED_BUILD=ON" | |
| } | |
| if ("${{matrix.preset}}" -like "*clang*") { | |
| echo "NOT adding SOURCELINK - not supported by clang's linker" | |
| } else { | |
| echo "Telling CMake to enable SOURCELINK" | |
| $args += "-DSOURCELINK=https://raw.githubusercontent.com/fredemmott/HTCC/${{github.sha}}" | |
| } | |
| $OutputRoot = "${{runner.temp}}/OUTPUT_ROOT" | |
| cmake ` | |
| ${{github.workspace}}/source ` | |
| --preset "${{matrix.preset}}" ` | |
| -DVERSION_TWEAK=${{github.run_number}} ` | |
| -DVERSION_TWEAK_LABEL=gha ` | |
| "-DOUTPUT_ROOT=${OutputRoot}" ` | |
| @args | |
| Add-Content $Env:GITHUB_OUTPUT "output-root=${OutputRoot}" | |
| - name: Build | |
| id: build | |
| working-directory: build | |
| run: | | |
| cmake --build . ` | |
| --parallel | |
| $version="$(Get-Content version.txt)" | |
| Add-Content $Env:GITHUB_OUTPUT "version=${version}" | |
| - name: Build installer-generator | |
| working-directory: source/HTCC-Installer | |
| shell: pwsh | |
| run: | | |
| dotnet publish ` | |
| --configuration Release ` | |
| --output "${{steps.configure.outputs.output-root}}/wixsharp" ` | |
| HTCC-Installer.csproj | |
| - name: Build installer | |
| id: installer | |
| shell: pwsh | |
| working-directory: ${{steps.configure.outputs.output-root}} | |
| run: | | |
| # Pin specifically to WiX 5.0.2 to avoid any potential EULA changes | |
| # https://github.com/wixtoolset/issues/issues/8974#issuecomment-2716432149 | |
| dotnet tool install --global wix --version '5.0.2' | |
| wix extension add -g WixToolset.UI.wixext/5.0.2 | |
| wix extension list -g | |
| wixsharp/HTCC-Installer.exe ` | |
| "$(Get-Location)" ` | |
| --stamp-file "${{github.workspace}}/installer.stamp" | |
| $InstallerPath = Get-Content "${{github.workspace}}/installer.stamp" | |
| $InstallerName = (Get-Item $InstallerPath).Name | |
| Add-Content $env:GITHUB_OUTPUT "installer-path=${InstallerPath}" | |
| Add-Content $env:GITHUB_OUTPUT "installer-name=${InstallerName}" | |
| - uses: actions/upload-artifact@v6 | |
| if: matrix.preset == 'Release' | |
| with: | |
| name: HTCC-v${{steps.build.outputs.version}}-bundle | |
| path: | | |
| ${{steps.configure.outputs.output-root}}/**/* | |
| !${{steps.configure.outputs.output-root}}/**/*.pdb | |
| !${{steps.configure.outputs.output-root}}/**/*.msi | |
| - uses: actions/upload-artifact@v6 | |
| if: matrix.preset == 'Release' | |
| with: | |
| name: HTCC-v${{steps.build.outputs.VERSION}}-DebugSymbols | |
| path: ${{steps.configure.outputs.output-root}}/bin/*.pdb | |
| - uses: actions/upload-artifact@v6 | |
| if: matrix.preset == 'Release' | |
| with: | |
| name: ${{steps.installer.outputs.installer-name}} | |
| path: ${{steps.installer.outputs.installer-path}} |