Wetterdaten-Support für Sessions hinzugefügt #7
Workflow file for this run
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 DLL and publish ZIP release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Validate SimHub reference DLLs exist | |
| shell: pwsh | |
| run: | | |
| $deps = @( | |
| "lib/simhub/SimHub.Plugins.dll", | |
| "lib/simhub/SimHub.Logging.dll", | |
| "lib/simhub/GameReaderCommon.dll", | |
| "lib/simhub/WoteverCommon.dll", | |
| "lib/simhub/WoteverLocalization.dll" | |
| ) | |
| $missing = @() | |
| foreach ($d in $deps) { | |
| if (-not (Test-Path $d)) { $missing += $d } | |
| } | |
| if ($missing.Count -gt 0) { | |
| throw "Fehlende Build-Abhängigkeiten (SimHub DLLs). Lege sie ins Repo unter 'lib/simhub': `n- " + ($missing -join "`n- ") | |
| } | |
| - name: Build (Release) | |
| shell: pwsh | |
| run: | | |
| # Ensure MSBuild can resolve SimHub references via ReferencePath | |
| $refPath = (Resolve-Path "lib/simhub").Path | |
| msbuild ".\LMU REST API.sln" /m /p:Configuration=Release /p:ReferencePath="$refPath" | |
| - name: Prepare dist folder (DLL only) | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path dist | Out-Null | |
| $dllPath = ".\LMU REST API\bin\Release\LMUEnergyPlugin.dll" | |
| if (!(Test-Path $dllPath)) { | |
| throw "DLL nicht gefunden unter: $dllPath. Prüfe OutputPath/AssemblyName oder ob Build fehlgeschlagen ist." | |
| } | |
| Copy-Item $dllPath -Destination ".\dist\" -Force | |
| - name: Create ZIP | |
| shell: pwsh | |
| run: | | |
| $tag = "${{ github.ref_name }}" # e.g. v0.0.0.1 | |
| $zipName = "LMU_RESTAPI_$tag.zip" # => LMU_RESTAPI_v0.0.0.1.zip | |
| if (Test-Path $zipName) { Remove-Item $zipName -Force } | |
| Compress-Archive -Path ".\dist\LMUEnergyPlugin.dll" -DestinationPath $zipName | |
| "ZIP_NAME=$zipName" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
| - name: Create GitHub Release and upload ZIP | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: | | |
| ${{ env.ZIP_NAME }} |