-
Notifications
You must be signed in to change notification settings - Fork 2
202 lines (200 loc) · 7.64 KB
/
ci.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: ci
on:
push:
branches: [ main, v* ]
pull_request:
branches: [ main, v* ]
workflow_dispatch:
jobs:
windows-x64:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
architecture: [ x64 ]
configuration: [ debug, release ]
os: [ windows ]
steps:
- uses: actions/checkout@v3
- run: ./scripts/cibuild.cmd -configuration ${{ matrix.configuration }} -architecture ${{ matrix.architecture }}
shell: cmd
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
windows-x86:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
architecture: [ x86 ]
configuration: [ debug, release ]
os: [ windows ]
steps:
- uses: actions/checkout@v3
- run: ./scripts/cibuild.cmd -configuration ${{ matrix.configuration }} -architecture ${{ matrix.architecture }} /p:PlatformTarget=${{ matrix.architecture }}
shell: cmd
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
linux-x64:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
architecture: [ x64 ]
configuration: [ debug, release ]
os: [ ubuntu ]
steps:
- uses: actions/checkout@v3
- run: ./scripts/cibuild.sh --configuration ${{ matrix.configuration }} --architecture ${{ matrix.architecture }}
shell: bash
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
macos-x64:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
architecture: [ x64 ]
configuration: [ debug, release ]
os: [ macos ]
steps:
- uses: actions/checkout@v3
- run: ./scripts/cibuild.sh --configuration ${{ matrix.configuration }} --architecture ${{ matrix.architecture }}
shell: bash
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}_${{ matrix.configuration }}_${{ matrix.architecture }}
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
build-nuget-preview:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- run: ./scripts/cibuild.cmd -configuration release -architecture x64
shell: cmd
env:
EXCLUDE_RUN_ID_FROM_PACKAGE: true
EXCLUDE_SUFFIX_FROM_VERSION: false
- uses: actions/upload-artifact@v3
with:
name: nuget_preview
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
sign-nuget-preview:
runs-on: windows-latest
if: ${{ github.event_name == 'push' }}
needs: [ build-nuget-preview ]
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
name: nuget_preview
path: ./artifacts
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- run: dotnet tool install --tool-path ./artifacts/tools sign --version 0.9.0-beta.23063.3
- run: ./artifacts/tools/sign code azure-key-vault "**/*.nupkg" --timestamp-url "http://timestamp.digicert.com" --base-directory "${{ github.workspace }}/artifacts/pkg" --file-list "${{ github.workspace }}/scripts/SignClientFileList.txt" --publisher-name "TerraFX" --description "TerraFX.Interop.PulseAudio" --description-url "https://github.com/terrafx/terrafx.interop.pulseaudio" --azure-key-vault-certificate "${{ secrets.SC_KEY_VAULT_CERTIFICATE_ID }}" --azure-key-vault-client-id "${{ secrets.SC_AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.SC_AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.SC_AZURE_TENANT_ID }}" --azure-key-vault-url "${{ secrets.SC_KEY_VAULT_URL }}"
- uses: actions/upload-artifact@v3
with:
name: sign_nuget_preview
path: |
./artifacts/pkg/**/*
if-no-files-found: error
build-nuget-release:
runs-on: windows-latest
if: false
steps:
- uses: actions/checkout@v3
- run: ./scripts/cibuild.cmd -configuration release -architecture x64
shell: cmd
env:
EXCLUDE_RUN_ID_FROM_PACKAGE: true
EXCLUDE_SUFFIX_FROM_VERSION: true
- uses: actions/upload-artifact@v3
with:
name: nuget_release
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
sign-nuget-release:
runs-on: windows-latest
if: ${{ github.event_name == 'push' }}
needs: [ build-nuget-release ]
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
name: nuget_release
path: ./artifacts
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- run: dotnet tool install --tool-path ./artifacts/tools sign --version 0.9.0-beta.23063.3
- run: ./artifacts/tools/sign code azure-key-vault "**/*.nupkg" --timestamp-url "http://timestamp.digicert.com" --base-directory "${{ github.workspace }}/artifacts/pkg" --file-list "${{ github.workspace }}/scripts/SignClientFileList.txt" --publisher-name "TerraFX" --description "TerraFX.Interop.PulseAudio" --description-url "https://github.com/terrafx/terrafx.interop.pulseaudio" --azure-key-vault-certificate "${{ secrets.SC_KEY_VAULT_CERTIFICATE_ID }}" --azure-key-vault-client-id "${{ secrets.SC_AZURE_CLIENT_ID }}" --azure-key-vault-client-secret "${{ secrets.SC_AZURE_CLIENT_SECRET }}" --azure-key-vault-tenant-id "${{ secrets.SC_AZURE_TENANT_ID }}" --azure-key-vault-url "${{ secrets.SC_KEY_VAULT_URL }}"
- uses: actions/upload-artifact@v3
with:
name: sign_nuget_release
path: |
./artifacts/pkg/**/*
if-no-files-found: error
publish-nightlies-azure:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview ]
steps:
- uses: actions/[email protected]
with:
name: windows_release_x64
path: ./artifacts
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
source-url: https://pkgs.terrafx.dev/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }}
- run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --api-key AzureDevOps --skip-duplicate
publish-nightlies-github:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, sign-nuget-preview ]
steps:
- uses: actions/[email protected]
with:
name: windows_release_x64
path: ./artifacts
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --source https://nuget.pkg.github.com/terrafx/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate