-
Notifications
You must be signed in to change notification settings - Fork 0
278 lines (270 loc) · 14.9 KB
/
Copy pathCD.yml
File metadata and controls
278 lines (270 loc) · 14.9 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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
name: Build and Deploy
on:
push:
tags:
- "v*"
env:
CONFIGURATION: Release
DOTNET_VERSION: 11.0.x
GH_PACKAGE_VERSION: net11.0
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # Enable GitHub OIDC token issuance for NuGet Trusted Publishing
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Trusted Publishing Auth
uses: NuGet/login@v1
id: trustedpublish
with:
user: ${{ secrets.NUGET_USER }}
- name: Build CHttp
run: |
dotnet build src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} --no-self-contained -p:Version=${VERSION}
dotnet build src/CHttp.Api/CHttp.Api.csproj --configuration ${{ env.CONFIGURATION }} --no-self-contained -p:Version=${VERSION}
dotnet build src/CHttpExecutor/CHttpExecutor.csproj --configuration ${{ env.CONFIGURATION }} --no-self-contained -p:Version=${VERSION}
dotnet build src/CHttpServer/CHttpServer/CHttpServer.csproj --configuration ${{ env.CONFIGURATION }} --no-self-contained -p:Version=${VERSION}
- name: Pack CHttp
run: |
dotnet pack src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${VERSION}
dotnet pack src/CHttp.Api/CHttp.Api.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${VERSION}
dotnet pack src/CHttpExecutor/CHttpExecutor.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${VERSION}
dotnet pack src/CHttpServer/CHttpServer/CHttpServer.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${VERSION}
- name: Push Nuget
run: |
dotnet nuget push src/CHttp/nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key "${{ steps.trustedpublish.outputs.NUGET_API_KEY }}" --skip-duplicate
dotnet nuget push src/CHttp.Api/nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key "${{ steps.trustedpublish.outputs.NUGET_API_KEY }}" --skip-duplicate
dotnet nuget push src/CHttpExecutor/nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key "${{ steps.trustedpublish.outputs.NUGET_API_KEY }}" --skip-duplicate
dotnet nuget push src/CHttpServer/CHttpServer/nupkg/*.nupkg --source https://api.nuget.org/v3/index.json --api-key "${{ steps.trustedpublish.outputs.NUGET_API_KEY }}" --skip-duplicate
- name: Build GitHub packages
run: |
# CHttp
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime win-x64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/CHttp.exe src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64.exe
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/CHttp.pdb src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64.pdb
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime win-arm64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/CHttp.exe src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64.exe
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/CHttp.pdb src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64.pdb
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime linux-x64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/CHttp src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttp-linux-x64
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/CHttp.pdb src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttp-linux-x64.pdb
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime linux-arm64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm64/publish/CHttp src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm64/publish/chttp-linux-arm64
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm64/publish/CHttp.pdb src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm64/publish/chttp-linux-arm64.pdb
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime linux-arm -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/CHttp src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/chttp-linux-arm
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/CHttp.pdb src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/chttp-linux-arm.pdb
# CHttp Aot Linux
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${VERSION} -p:PublishAot=true --runtime linux-x64 --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/CHttp src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttp-linux-x64-aot
# CHttpExecutor
dotnet publish src/CHttpExecutor/CHttpExecutor.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime win-x64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/CHttpExecutor.exe src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttpexec-win-x64.exe
dotnet publish src/CHttpExecutor/CHttpExecutor.csproj --configuration ${{ env.CONFIGURATION }} --self-contained --runtime linux-x64 -p:Version=${VERSION} -p:PublishSingleFile=true -p:PublishTrimmed=true --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/CHttpExecutor src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttpexec-linux-x64
- name: Publish to GitHub
uses: softprops/action-gh-release@v3
with:
files: |
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64.exe
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64.pdb
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64.exe
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64.pdb
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttp-linux-x64
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttp-linux-x64.pdb
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm64/publish/chttp-linux-arm64
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm64/publish/chttp-linux-arm64.pdb
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/chttp-linux-arm
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-arm/publish/chttp-linux-arm.pdb
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttp-linux-x64-aot
src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttpexec-win-x64.exe
src/CHttpExecutor/bin/Release/${{ env.GH_PACKAGE_VERSION }}/linux-x64/publish/chttpexec-linux-x64
- name: Build VSCodeExtension dependencies
run: |
dotnet publish src/CHttpExtension -r linux-x64 -f net9.0 # .NET 9
- name: Upload CHttpExtension file to artifacts (linux-x64)
uses: actions/upload-artifact@v7
with:
name: CHttpExtension-linux-x64 # The name of the artifact bundle
path: src/CHttpExtension/bin/Release/net9.0/linux-x64/publish/*
cross-compile-linux-aot:
runs-on: ubuntu-26.04-arm
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Build VSCodeExtension dependencies
run: |
dotnet publish src/CHttpExtension -r linux-arm64 -f net9.0 # .NET 9
- name: Upload CHttpExtension file to artifacts (linux-arm64)
uses: actions/upload-artifact@v7
with:
name: CHttpExtension-linux-arm64 # The name of the artifact bundle
path: src/CHttpExtension/bin/Release/net9.0/linux-arm64/publish/*
cross-compile-windows-aot:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Set VERSION variable from tag
run: |
$ver="${{GITHUB.REF_NAME}}" -replace 'v', ''
echo "VERSION=${ver}" >> $env:GITHUB_ENV
- name: Build GitHub packages
run: |
# CHttp Aot Windows
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${{ env.VERSION }} -p:PublishAot=true --runtime win-x64 --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/CHttp.exe src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64-aot.exe
dotnet publish src/CHttp/CHttp.csproj --configuration ${{ env.CONFIGURATION }} -p:Version=${{ env.VERSION }} -p:PublishAot=true --runtime win-arm64 --framework ${{ env.GH_PACKAGE_VERSION }}
mv src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/CHttp.exe src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64-aot.exe
- name: Publish to GitHub
uses: softprops/action-gh-release@v3
with:
files: |
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-x64/publish/chttp-win-x64-aot.exe
src/CHttp/bin/Release/${{ env.GH_PACKAGE_VERSION }}/win-arm64/publish/chttp-win-arm64-aot.exe
- name: Build VSCodeExtension dependencies
run: |
dotnet publish src/CHttpExtension -r win-x64 -f net9.0 # .NET 9
dotnet publish src/CHttpExtension -r win-arm64 -f net9.0 # .NET 9
- name: Upload CHttpExtension file to artifacts (win-x64)
uses: actions/upload-artifact@v7
with:
name: CHttpExtension-win-x64 # The name of the artifact bundle
path: src/CHttpExtension/bin/Release/net9.0/win-x64/publish/*
- name: Upload CHttpExtension file to artifacts (win-arm64)
uses: actions/upload-artifact@v7
with:
name: CHttpExtension-win-arm64 # The name of the artifact bundle
path: src/CHttpExtension/bin/Release/net9.0/win-arm64/publish/*
vscodeextension-linux-x64:
runs-on: ubuntu-latest
needs: [build-and-deploy]
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 26.x
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Download Platform Specific Artifacts (linux-x64)
uses: actions/download-artifact@v8
with:
name: CHttpExtension-linux-x64
path: src/VSCodeExt/src/chttp-linux-x64
- name: Publish VSCE
run: |
pushd ./src/VSCodeExt/
npm install
npm run vsce-deploy-linux-x64 ${VERSION}
popd
- name: Release
uses: softprops/action-gh-release@v3
with:
files: |
src/VSCodeExt/chttp-linux-x64.vsix
vscodeextension-linux-arm64:
runs-on: ubuntu-latest
needs: [cross-compile-linux-aot]
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 26.x
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Download Platform Specific Artifacts (linux-arm64)
uses: actions/download-artifact@v8
with:
name: CHttpExtension-linux-arm64
path: src/VSCodeExt/src/chttp-linux-arm64
- name: Publish VSCE
run: |
pushd ./src/VSCodeExt/
npm install
npm run vsce-deploy-linux-arm64 ${VERSION}
popd
- name: Release
uses: softprops/action-gh-release@v3
with:
files: |
src/VSCodeExt/chttp-linux-arm64.vsix
vscodeextension-win-x64:
runs-on: ubuntu-latest
needs: [cross-compile-windows-aot]
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 26.x
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Download Platform Specific Artifacts (win-x64)
uses: actions/download-artifact@v8
with:
name: CHttpExtension-win-x64
path: src/VSCodeExt/src/chttp-win32-x64
- name: Publish VSCE
run: |
pushd ./src/VSCodeExt/
npm install
npm run vsce-deploy-win-x64 ${VERSION}
popd
- name: Release
uses: softprops/action-gh-release@v3
with:
files: |
src/VSCodeExt/chttp-win-x64.vsix
vscodeextension-win-arm64:
runs-on: ubuntu-latest
needs: [cross-compile-windows-aot]
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 26.x
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Download Platform Specific Artifacts (win-arm64)
uses: actions/download-artifact@v8
with:
name: CHttpExtension-win-arm64
path: src/VSCodeExt/src/chttp-win32-arm64
- name: Publish VSCE
run: |
pushd ./src/VSCodeExt/
npm install
npm run vsce-deploy-win-arm64 ${VERSION}
popd
- name: Release
uses: softprops/action-gh-release@v3
with:
files: |
src/VSCodeExt/chttp-win-arm64.vsix