-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (31 loc) · 1.32 KB
/
cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Deploy to Nuget.org
on:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Build Version
run: |
Import-Module .\build\GetBuildVersion.psm1
Write-Host $Env:GITHUB_REF
$version = GetBuildVersion -VersionString $Env:GITHUB_REF
echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
shell: pwsh
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: '8.0.x'
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Restore Dependencies
run: dotnet restore Ktx2Sharp.sln
- name: Build
run: dotnet build Source/Ktx2Sharp.csproj --configuration Release -p:Version=$BUILD_VERSION --no-restore
- name: Pack
run: dotnet pack Source/Ktx2Sharp.csproj --configuration Release -p:Version=$BUILD_VERSION --no-restore
- name: Publish
if: startsWith(github.ref, 'refs/tags')
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET}}