|
| 1 | +name: Release-Build |
| 2 | +permissions: |
| 3 | + contents: write |
| 4 | + pages: write |
| 5 | + packages: write |
| 6 | + actions: read |
| 7 | + |
| 8 | +defaults: |
| 9 | + run: |
| 10 | + shell: pwsh |
| 11 | + |
| 12 | +# only comes into play on a PUSH of a tag to the repository |
| 13 | +on: |
| 14 | + push: |
| 15 | + tags: |
| 16 | + - 'v*' |
| 17 | + |
| 18 | +env: |
| 19 | + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 |
| 20 | + DOTNET_CLI_TELEMETRY_OPTOUT: 1 |
| 21 | + DOTNET_NOLOGO: true |
| 22 | + |
| 23 | +jobs: |
| 24 | + build_target: |
| 25 | + runs-on: windows-latest |
| 26 | + steps: |
| 27 | + - name: Checkout Repo |
| 28 | + uses: actions/checkout@v2 |
| 29 | + with: |
| 30 | + persist-credentials: false |
| 31 | + fetch-depth: 0 |
| 32 | + |
| 33 | + - name: Build Source |
| 34 | + run: .\Build-Source.ps1 -FullInit -ForceClean |
| 35 | + |
| 36 | + - name: Run Tests |
| 37 | + run: ./Invoke-Tests.ps1 |
| 38 | + |
| 39 | + - name: Publish Test Results |
| 40 | + uses: actions/upload-artifact@v4 |
| 41 | + with: |
| 42 | + name: test-results |
| 43 | + path: BuildOutput/Test-Results/*.trx |
| 44 | + |
| 45 | + - name: Publish Artifacts |
| 46 | + uses: actions/upload-artifact@v4 |
| 47 | + with: |
| 48 | + name: nuget-packages |
| 49 | + path: .\BuildOutput\Nuget |
| 50 | + |
| 51 | + - name: Show asset names |
| 52 | + run: dir BuildOutput/Nuget |
| 53 | + |
| 54 | + - name: Build Docs |
| 55 | + run: ./Build-Docs.ps1 |
| 56 | + |
| 57 | + - name: Commit Docs |
| 58 | + env: |
| 59 | + docspush_email: 32618965+cibuild-telliam@users.noreply.github.com |
| 60 | + docspush_username: cibuild-telliam |
| 61 | + run: .\Commit-Docs.ps1 |
| 62 | + |
| 63 | + - name: Publish Docs |
| 64 | + uses: ad-m/github-push-action@master |
| 65 | + with: |
| 66 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + directory: .\BuildOutput\docs |
| 68 | + branch: gh-pages |
| 69 | + |
| 70 | + - name: Publish packages to NuGet.org |
| 71 | + run: | |
| 72 | + if( [string]::IsNullOrWhiteSpace('${{secrets.NUGETPUSH_ACCESS_TOKEN}}')) |
| 73 | + { |
| 74 | + throw "'NUGETPUSH_ACCESS_TOKEN' does not exist, is empty or all whitespace!" |
| 75 | + } |
| 76 | + dotnet nuget push .\BuildOutput\NuGet\*.nupkg --api-key '${{secrets.NUGETPUSH_ACCESS_TOKEN}}' --source 'https://api.nuget.org/v3/index.json' --skip-duplicate |
| 77 | +
|
| 78 | + - name: Create Release |
| 79 | + if: (!cancelled()) |
| 80 | + uses: softprops/action-gh-release@v2 |
| 81 | + with: |
| 82 | + draft: true |
| 83 | + files: BuildOutput/NuGet/*.nupkg |
| 84 | + |
0 commit comments