Skip to content

6.1.3 (#10)

6.1.3 (#10) #14

name: CD
on:
# workflow_run:
# workflows: ["CI"]
# branches: [ master ]
# types:
# - completed
push:
branches:
- master
jobs:
build:
env:
BUILD_CONFIG: 'Release'
SOLUTION: './Solution/Modules.sln'
MESSAGE: $(git log -1 --no-merges --pretty='format:%C(auto)%s')
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Build Version
run: |
Get-ChildItem
Import-Module .\Solution\Tools\GetBuildVersion.psm1
Write-Host $env:MESSAGE
$version = GetBuildVersion -VersionString $env:MESSAGE
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore dependencies
run: nuget restore $env:SOLUTION
- name: Build
run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG /p:AssemblyVersion=$BUILD_VERSION --no-restore
- name: Run tests
run: dotnet test $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal
- name: Publish
if: startsWith(github.ref, 'refs/heads/release')
run: |
dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}
dotnet nuget push **\*.nupkg --source 'https://nuget.pkg.github.com/joshika39/index.json' --api-key ${{secrets.GIT_API_KEY}}