Skip to content

Merge pull request #2 from transmitly/refactor/core #2

Merge pull request #2 from transmitly/refactor/core

Merge pull request #2 from transmitly/refactor/core #2

Workflow file for this run

#execute fails if we use a try to use a reusable workflow
# - Checkout is 'shallow' despite fetch-depth: 0
# - Command failed: C:\hostedtoolcache\windows\GitVersion.Tool\6.0.2\dotnet-gitversion.exe with no error message
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
channelProviderName: Transmitly.Microsoft.Aspnet.Mvc
buildConfiguration: Release
jobs:
windows-build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3.0.0
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/execute@v3.0.0
with:
disableShallowCloneCheck: true
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: dotnet
uses: actions/setup-dotnet@v3
- name: Build netcore solution
run: dotnet build ${{env.channelProviderName}}.sln --configuration ${{env.buildConfiguration}} -p:AssemblyVersion=${{ env.majorMinorPatch }} -p:FileVersion=${{ env.majorMinorPatch }} -p:InformationalVersion=${{ env.informationalVersion }}
- name: Package
run: dotnet pack --no-build --include-source /p:Version=${{ env.majorMinorPatch }} --configuration ${{env.buildConfiguration}} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Publish Nuget
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 }}
- name: Add github source
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"
- name: Publish (Github)
run: dotnet nuget push src\${{env.channelProviderName}}\bin\${{env.buildConfiguration}}\${{env.channelProviderName}}*.nupkg --api-key ${{secrets.PUBLISH_GITHUB_PACKAGE_API_KEY}} --source "github"