Fixed build errors #31
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 | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| release: | |
| types: | |
| - published | |
| defaults: | |
| run: | |
| shell: pwsh | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-slim | |
| steps: | |
| - name: Setup .NET 10.0 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0 | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Check if Tests are Included in NuGet Package | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: '1' | |
| run: dotnet run --project ./.github/workflows/CheckTestAreNotIncluded --configuration Release | |
| - name: Test | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: '1' | |
| run: dotnet test --configuration Debug --environment InMemory=true | |
| - name: Generate NuGet Package | |
| if: github.event_name == 'release' | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: '1' | |
| shell: pwsh | |
| run: | | |
| [Convert]::FromBase64String("${{ secrets.KeyFile }}") | Set-Content ./CloudStub.snk -AsByteStream | |
| $versionInfo = '${{ github.event.release.tag_name }}' -split '[-+]', 2 | |
| $baseVersion = $versionInfo[0] | |
| $revision = if ($versionInfo.Length -eq 1) { 0 } else { [int]([DateTime]::UtcNow - [DateTime]::UtcNow.Date).TotalMinutes } | |
| dotnet pack CloudStub.AzureDataTables/CloudStub.AzureDataTables.csproj ` | |
| --configuration Release ` | |
| --output Publish ` | |
| -property:Version="$($baseVersion).$($revision)" ` | |
| -property:PackageVersion='${{ github.event.release.tag_name }}' ` | |
| -property:RepositoryCommit=${{ github.event.head_commit.id }} ` | |
| -property:SignAssembly=True ` | |
| -property:AssemblyOriginatorKeyFile=../CloudStub.snk | |
| gh release upload ` | |
| '${{ github.event.release.tag_name }}' ` | |
| './Publish/CloudStub.AzureDataTables.${{ github.event.release.tag_name }}.nupkg' |