Repository navigation
113 lines (101 loc) · 3.12 KB
/
Copy pathrelease.yml
File metadata and controls
113 lines (101 loc) · 3.12 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Sign and publish NuGet packages
on:
workflow_call:
secrets:
SIGN_KEY_VAULT_URL:
required: true
SIGN_CLIENT_ID:
required: true
SIGN_CLIENT_SECRET:
required: true
SIGN_TENANT_ID:
required: true
SIGN_CERTIFICATE:
required: true
NUGET_USER:
required: true
jobs:
sign:
name: Sign
runs-on: windows-latest
permissions:
id-token: write
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Download packages
uses: actions/download-artifact@v7
with:
name: nuget-packages
path: ${{ github.workspace }}/packages
- name: Download signing file list
uses: actions/download-artifact@v7
with:
name: nuget-list
path: ${{ github.workspace }}
- name: Install signing tool
run: dotnet tool install --tool-path ./tools sign --version 0.9.1-beta.23356.1
- name: Sign packages
run: >
./tools/sign code azure-key-vault
**/*.nupkg
--base-directory "${{ github.workspace }}/packages"
--file-list "${{ github.workspace }}/SignClientFileList.txt"
--timestamp-url "http://timestamp.digicert.com"
--publisher-name ".NET Foundation"
--description "AI Community Toolkit"
--description-url "https://github.com/CommunityToolkit/AI"
--azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}"
--azure-key-vault-client-id ${{ secrets.SIGN_CLIENT_ID }}
--azure-key-vault-client-secret "${{ secrets.SIGN_CLIENT_SECRET }}"
--azure-key-vault-tenant-id ${{ secrets.SIGN_TENANT_ID }}
--azure-key-vault-certificate "${{ secrets.SIGN_CERTIFICATE }}"
--verbosity Information
- name: Upload signed packages
uses: actions/upload-artifact@v6
with:
name: signed-nuget-packages
if-no-files-found: error
path: ${{ github.workspace }}/packages/**/*.nupkg
release:
name: GitHub Release
needs: sign
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download signed packages
uses: actions/download-artifact@v7
with:
name: signed-nuget-packages
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
files: ./*.nupkg
publish-nuget:
name: Publish to NuGet
needs: sign
runs-on: ubuntu-latest
environment:
name: nuget-release-gate
permissions:
id-token: write
contents: read
steps:
- name: Download signed packages
uses: actions/download-artifact@v7
with:
name: signed-nuget-packages
- name: NuGet login (OIDC)
id: login
uses: NuGet/login@v1
with:
user: ${{ secrets.NUGET_USER }}
- name: Push to NuGet.org
run: >
dotnet nuget push ./*.nupkg
--source "https://api.nuget.org/v3/index.json"
--api-key ${{ steps.login.outputs.NUGET_API_KEY }}
--skip-duplicate