-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.71 KB
/
nuget-cd-latest.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Publish package
# This workflow is triggered on pushes to the repository.
on:
push:
tags:
- 4.[0-9]+.[0-9]+
jobs:
build:
name: Deploy NuGet package
runs-on: windows-latest
env:
FS_API_KEY: "${{ secrets.FS_CI_CAMPAIGNS_API_KEY }}"
FS_ENV_ID: "${{ secrets.FS_CI_CAMPAIGNS_ENV_ID }}"
ASSEMBLY_SIGNING_KEY: "${{ secrets.ASSEMBLY_SIGNING_KEY }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: Restore NuGet Packages
run: dotnet restore Flagship.sln
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Run tests
shell: pwsh
run: ./test-run-ci.bat
working-directory: Flagship.Tests
- name: Create signing Key file
shell: pwsh
run: $Env:ASSEMBLY_SIGNING_KEY | Out-File -FilePath flagshipSigningKey.txt
working-directory: Flagship
- name: Decode signing Key
shell: pwsh
run: certutil -decode .\flagshipSigningKey.txt .\flagshipSigningKey.snk
working-directory: Flagship
- name: Build nuget
run: MSBuild.exe -t:pack -property:Configuration=Release -property:SignAssembly=True -property:AssemblyOriginatorKeyFile=flagshipSigningKey.snk
working-directory: Flagship
- name: set Nuget api key
run: nuget setApiKey ${{ secrets.NUGET_APIKEY }}
- name: Push Nuget Packages
run: nuget push Flagship.SDK.*.nupkg -Source https://api.nuget.org/v3/index.json
working-directory: Flagship/NugetPackageRelease