|
| 1 | +#execute fails if we use a try to use a reusable workflow |
| 2 | +# - Checkout is 'shallow' despite fetch-depth: 0 |
| 3 | +# - Command failed: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.2\dotnet-gitversion.exe with no error message |
| 4 | +name: Release |
| 5 | +on: |
| 6 | + push: |
| 7 | + tags: |
| 8 | + - "v[0-9]+.[0-9]+.[0-9]+" |
| 9 | +env: |
| 10 | + channelProviderName: Transmitly.Microsoft.Aspnet.Mvc |
| 11 | + buildConfiguration: Release |
| 12 | +jobs: |
| 13 | + windows-build: |
| 14 | + runs-on: windows-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + - name: Verify commit exists in origin/main |
| 20 | + run: | |
| 21 | + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* |
| 22 | + git branch --remote --contains | grep origin/main |
| 23 | + - name: Install GitVersion |
| 24 | + uses: gittools/actions/gitversion/[email protected] |
| 25 | + with: |
| 26 | + versionSpec: '5.x' |
| 27 | + - name: Determine Version |
| 28 | + uses: gittools/actions/gitversion/[email protected] |
| 29 | + with: |
| 30 | + disableShallowCloneCheck: true |
| 31 | + - name: Setup MSBuild |
| 32 | + uses: microsoft/setup-msbuild@v1 |
| 33 | + - name: dotnet |
| 34 | + uses: actions/setup-dotnet@v3 |
| 35 | + - name: Build netcore solution |
| 36 | + run: dotnet build ${{env.channelProviderName}}.sln --configuration ${{env.buildConfiguration}} -p:AssemblyVersion=${{ env.majorMinorPatch }} -p:FileVersion=${{ env.majorMinorPatch }} -p:InformationalVersion=${{ env.informationalVersion }} |
| 37 | + - name: Package |
| 38 | + run: dotnet pack --no-build --include-source /p:Version=${{ env.majorMinorPatch }} --configuration ${{env.buildConfiguration}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg |
| 39 | + - name: Publish Nuget |
| 40 | + run: dotnet nuget push src\${{env.channelProviderName}}\bin\${{env.buildConfiguration}}\${{env.channelProviderName}}*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} |
| 41 | + - name: Add github source |
| 42 | + run: dotnet nuget add source --username ${{ secrets.PUBLISH_GITHUB_USERNAME }} --password ${{ secrets.PUBLISH_GITHUB_PACKAGE_API_KEY }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/transmitly/index.json" |
| 43 | + - name: Publish (Github) |
| 44 | + run: dotnet nuget push src\${{env.channelProviderName}}\bin\${{env.buildConfiguration}}\${{env.channelProviderName}}*.nupkg --api-key ${{secrets.PUBLISH_GITHUB_PACKAGE_API_KEY}} --source "github" |
0 commit comments