-
Notifications
You must be signed in to change notification settings - Fork 16
595 lines (491 loc) · 21.5 KB
/
dotnet.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
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
name: Meadow.CLI
env:
CLI_RELEASE_VERSION: 1.5.0.0
IDE_TOOLS_RELEASE_VERSION: 1.5.0
MEADOW_OS_VERSION: 1.5.0.0
VS_MAC_2019_VERSION: 8.10
VS_MAC_2022_VERSION: 17.6
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-and-optionally-publish-nuget:
runs-on: windows-latest
name: Build and Optionally Publish Meadow.CLI nuget
steps:
- name: Checkout Meadow.CLI
uses: actions/checkout@v2
with:
path: main
- name: Checkout Meadow.Contracts side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.Contracts
path: Meadow.Contracts
ref: main
- name: Checkout Meadow.Logging side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.Logging
path: Meadow.Logging
ref: main
- name: Checkout Meadow.Units side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.Units
path: Meadow.Units
ref: main
- name: Setup .NET Core SDK 6.0.x & 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
7.0.x
- name: Setup NuGet
uses: NuGet/[email protected]
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update CLI Version Numbers
run: |
$content = Get-Content main/Meadow.CLI/Meadow.CLI.csproj | Out-String
$newcontent = $content -replace '<PackageVersion>.*</PackageVersion>', '<PackageVersion>${{ ENV.CLI_RELEASE_VERSION }}</PackageVersion>'
$newcontent | Set-Content main/Meadow.CLI/Meadow.CLI.csproj
$content = Get-Content main/Meadow.CLI.Core/Meadow.CLI.Core.csproj | Out-String
$newcontent = $content -replace '<Version>.*</Version>', '<Version>${{ ENV.CLI_RELEASE_VERSION }}</Version>'
$newcontent | Set-Content main/Meadow.CLI.Core/Meadow.CLI.Core.csproj
$content = Get-Content main/Meadow.CLI.Core/Meadow.CLI.Core.6.0.0.csproj | Out-String
$newcontent = $content -replace '<Version>.*</Version>', '<Version>${{ ENV.CLI_RELEASE_VERSION }}</Version>'
$newcontent | Set-Content main/Meadow.CLI.Core/Meadow.CLI.Core.6.0.0.csproj
$content = Get-Content main/Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj | Out-String
$newcontent = $content -replace '<Version>.*</Version>', '<Version>${{ ENV.CLI_RELEASE_VERSION }}</Version>'
$newcontent | Set-Content main/Meadow.CLI.Core/Meadow.CLI.Core.VS2019.csproj
$content = Get-Content main/Meadow.CLI.Core/Constants.cs | Out-String
$newcontent = $content -replace 'CLI_VERSION = \".*\";', 'CLI_VERSION = "${{ ENV.CLI_RELEASE_VERSION }}";'
$newcontent | Set-Content main/Meadow.CLI.Core/Constants.cs
- name: Add MSBuild to Path
uses: microsoft/[email protected]
- name: Restore Classic dependencies
run: dotnet restore main/MeadowCLI.Classic.sln /p:Configuration=Release
- name: Build Classic CLI
run: dotnet build main/MeadowCLI.Classic.sln /p:Configuration=Release
- name: Upload nuget Artifacts for internal testing
uses: actions/upload-artifact@v2
with:
name: Meadow.CLI.Classic.nuget.${{ ENV.CLI_RELEASE_VERSION }}
path: 'main\Meadow.CLI.Classic\bin\Release\*.nupkg'
- name: Restore normal dependencies
run: dotnet restore main/MeadowCLI.sln /p:Configuration=Release
- name: Build normal CLI
run: dotnet build main/MeadowCLI.sln /p:Configuration=Release
- name: Upload nuget Artifacts for internal testing
uses: actions/upload-artifact@v2
with:
name: Meadow.CLI.nuget.${{ ENV.CLI_RELEASE_VERSION }}
path: 'main\Meadow.CLI\bin\Release\*.nupkg'
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Publish Meadow.CLI Nuget publically
run: |
nuget push main\Meadow.CLI\bin\Release\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
- name: Restore V2 dependencies
run: dotnet restore main/Source/v2/Meadow.CLI.v2.sln /p:Configuration=Release
- name: Build V2 CLI
run: dotnet build main/Source/v2/Meadow.CLI.v2.sln /p:Configuration=Release
- name: Upload nuget Artifacts for internal testing
uses: actions/upload-artifact@v2
with:
name: Meadow.CLI.V2.nuget.2.0.0
path: 'main\Source\v2\Meadow.CLI\bin\Release\*.nupkg'
#- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
# name: Publish Meadow.CLI v2.0 Nuget publically
# run: |
# nuget push main\Source\v2\Meadow.CLI\bin\Release\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
# build-vswin-2019:
# runs-on: windows-2019
# needs: [build-and-optionally-publish-nuget]
# name: Build Win 2019 Extension
# steps:
# - name: Checkout Meadow.CLI.Core side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/Meadow.CLI
# path: Meadow.CLI
# - if: ${{ github.ref == 'refs/heads/main' }}
# name: Checkout Win Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Win_Meadow_Extension
# path: vs-win
# ref: main
# - if: ${{ github.ref != 'refs/heads/main' }}
# name: Checkout Win Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Win_Meadow_Extension
# path: vs-win
# - name: Setup .NET Core SDK 5.0.x, 6.0.x & 7.0.x
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: |
# 5.0.x
# 6.0.x
# 7.0.x
# - name: Setup NuGet
# uses: NuGet/[email protected]
# - name: Add MSBuild to Path
# uses: microsoft/[email protected]
# - if: ${{ github.event_name == 'workflow_dispatch' }}
# name: Update VS2019 Version Numbers
# run: |
# $content = Get-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2019/source.extension.vsixmanifest | Out-String
# $newcontent = $content -replace 'Version="1.*" Language="en-US" Publisher="Wilderness Labs"', 'Version="${{ ENV.IDE_TOOLS_RELEASE_VERSION }}" Language="en-US" Publisher="Wilderness Labs"'
# $newcontent | Set-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2019/source.extension.vsixmanifest
# - name: Restore VS2019 dependencies
# run: dotnet restore vs-win/VS_Meadow_Extension.2019.sln /p:Configuration=Release
# - name: Build VS2019 Extension
# id: VS2019-Extension
# run: msbuild vs-win/VS_Meadow_Extension.2019.sln /t:Rebuild /p:Configuration=Release
# env:
# DevEnvDir: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE'
# - name: Upload VS2019 VSIX Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Meadow.Win.VS2019.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
# path: 'vs-win\VS_Meadow_Extension\VS_Meadow_Extension.2019\bin\Release\*.vsix'
#- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
# name: Publish VS2019 Extension
# run: |
# & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" publish -payload "vs-win\VS_Meadow_Extension\VS_Meadow_Extension.2019\bin\Release\Meadow.2019.vsix" -publishManifest "vs-win\publishManifest.json" -ignoreWarnings "VSIXValidatorWarning01,VSIXValidatorWarning02" -personalAccessToken "${{secrets.MARKETPLACE_PUBLISH_PAT}}"
build-vswin-2022:
runs-on: windows-2022
needs: [build-and-optionally-publish-nuget]
name: Build Win 2022 Extension
steps:
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout Win Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Win_Meadow_Extension
path: vs-win
ref: main
- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout Win Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Win_Meadow_Extension
path: vs-win
- name: Setup .NET Core SDK 6.0.x & 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
7.0.x
- name: Setup NuGet
uses: NuGet/[email protected]
- name: Add MSBuild to Path
uses: microsoft/[email protected]
with:
vs-version: '[17.0, 18.0)'
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VS2022 Version Numbers
run: |
$content = Get-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2022/source.extension.vsixmanifest | Out-String
$newcontent = $content -replace 'Version="1.*" Language="en-US" Publisher="Wilderness Labs"', 'Version="${{ ENV.IDE_TOOLS_RELEASE_VERSION }}" Language="en-US" Publisher="Wilderness Labs"'
$newcontent | Set-Content vs-win/VS_Meadow_Extension/VS_Meadow_Extension.2022/source.extension.vsixmanifest
- name: Restore VS2022 dependencies
run: dotnet restore vs-win/VS_Meadow_Extension.2022.sln /p:Configuration=Release
- name: Build VS2022 Extension
run: msbuild vs-win/VS_Meadow_Extension.2022.sln /t:Rebuild /p:Configuration=Release
env:
DevEnvDir: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE'
- name: Upload VS2022 VSIX Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Win.VS2022.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'vs-win\VS_Meadow_Extension\VS_Meadow_Extension.2022\bin\Release\*.vsix'
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Publish VS2022 Extension
run: |
& "${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" publish -payload "vs-win\VS_Meadow_Extension\VS_Meadow_Extension.2022\bin\Release\Meadow.2022.vsix" -publishManifest "vs-win\publishManifest.2022.json" -ignoreWarnings "None" -personalAccessToken "${{secrets.MARKETPLACE_PUBLISH_PAT}}"
# build-vsmac-2019:
# name: Build Mac 2019 Extension
# needs: [build-and-optionally-publish-nuget]
# runs-on: macos-11
# steps:
# - name: Checkout Meadow.CLI.Core side-by-side
# uses: actions/checkout@v2
# with:
# path: Meadow.CLI
# - if: ${{ github.ref == 'refs/heads/main' }}
# name: Checkout Mac Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Mac_Meadow_Extension
# path: vs-mac
# ref: main
# - if: ${{ github.ref != 'refs/heads/main' }}
# name: Checkout Mac Extension side-by-side
# uses: actions/checkout@v2
# with:
# repository: WildernessLabs/VS_Mac_Meadow_Extension
# path: vs-mac
# - name: Set default Xcode 13.0
# run: |
# XCODE_ROOT=/Applications/Xcode_13.0.0.app
# echo "MD_APPLE_SDK_ROOT=$XCODE_ROOT" >> $GITHUB_ENV
# sudo xcode-select -s $XCODE_ROOT
# - name: Setup .NET Core SDK 5.0.x, 6.0.x & 7.0.x
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: |
# 5.0.x
# 6.0.x
# 7.0.x
# - name: Setup NuGet
# uses: NuGet/[email protected]
# - name: Work around so that VS2019 is picked up.
# run: |
# mv "/Applications/Visual Studio.app" "/Applications/Visual Studio 2022.app"
# mv "/Applications/Visual Studio 2019.app" "/Applications/Visual Studio.app"
# - if: ${{ github.event_name == 'workflow_dispatch' }}
# name: Update VS2019 Version Numbers
# run: |
# sed -i "" "s/Version = \"1.*\"/Version = \"${{ENV.IDE_TOOLS_RELEASE_VERSION}}\"/" vs-mac/VS4Mac_Meadow_Extension/Properties/AddinInfo.cs
# - name: Restore our VS2019 project
# run: |
# msbuild vs-mac/VS4Mac_Meadow_Extension.sln /t:Restore /p:Configuration=Release
# - name: Build and Package the VS2019 Extension
# run: |
# msbuild vs-mac/VS4Mac_Meadow_Extension.sln /t:Build /p:Configuration=Release /p:CreatePackage=true
# - name: Upload Mac VS2019 mpack Artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Meadow.Mac.2019.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
# path: 'vs-mac/VS4Mac_Meadow_Extension/bin/Release/net472/*.mpack'
#- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
# name: Get Commit Messages
# id: commit_messages
# uses: actions/github-script@v6
# with:
# github-token: ${{ secrets.MEADOW_MAC_TOKEN }}
# script: |
# const { owner, repo } = context.repo;
# const latestRelease = await github.rest.repos.getLatestRelease({
# owner: 'WildernessLabs',
# repo: 'VS_Mac_Meadow_Extension',
# });
# const commits = await github.rest.repos.listCommits({
# owner: 'WildernessLabs',
# repo: 'VS_Mac_Meadow_Extension',
# since: latestRelease.created_at
# });
# const messages = commits.data.map(commit => `* ${commit.commit.message}`).join(' \n');
# const formattedMessages = `## What's Changed \n${messages}`;
# return formattedMessages;
#- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
# name: Create VS2019 Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.MEADOW_MAC_TOKEN }}
# with:
# owner: WildernessLabs
# repo: VS_Mac_Meadow_Extension
# tag_name: v${{ ENV.IDE_TOOLS_RELEASE_VERSION }}-vsm${{ ENV.VS_MAC_2019_VERSION }}
# release_name: VS Mac VS2019 Extension v${{ ENV.IDE_TOOLS_RELEASE_VERSION }} for Meadow OS v${{ ENV.MEADOW_OS_VERSION }}
# body: |
# ${{ steps.commit_messages.outputs.result }}
# draft: true
# prerelease: false
# commitish: main
# - if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
#- name: Upload Release Asset
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.MEADOW_MAC_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: vs-mac/VS4Mac_Meadow_Extension/bin/Release/net472/*.mpack
# asset_name: Meadow.Mac.2019.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
# asset_content_type: application/zip
build-vsmac-2022:
name: Build Mac 2022 Extension
needs: [build-and-optionally-publish-nuget]
runs-on: macos-12
steps:
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
path: Meadow.CLI
- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout Mac Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Mac_Meadow_Extension
path: vs-mac
ref: main
- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout Mac Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VS_Mac_Meadow_Extension
path: vs-mac
- name: Setup .NET Core SDK 6.0.x & 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
7.0.x
- name: Setup NuGet
uses: NuGet/[email protected]
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VS2022 Version Numbers
run: |
sed -i "" "s/Version = \"1.*\"/Version = \"${{ ENV.IDE_TOOLS_RELEASE_VERSION }}\"/" vs-mac/VS4Mac_Meadow_Extension/Properties/AddinInfo.2022.cs
- name: Restore our VS2022 project
run: |
dotnet msbuild vs-mac/VS4Mac_Meadow_Extension/Meadow.Sdks.IdeExtensions.Vs4Mac.2022.csproj /t:Restore /p:Configuration=Release
- name: Build and Package the VS2022 Extension
run: |
dotnet msbuild vs-mac/VS4Mac_Meadow_Extension/Meadow.Sdks.IdeExtensions.Vs4Mac.2022.csproj /t:Build /p:Configuration=Release /p:CreatePackage=true
- name: Upload VS2022 mpack Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Mac.2022.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'vs-mac/VS4Mac_Meadow_Extension/bin/Release/net7.0/*.mpack'
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Get Commit Messages
id: commit_messages
uses: actions/github-script@v6
with:
github-token: ${{ secrets.MEADOW_MAC_TOKEN }}
script: |
const { owner, repo } = context.repo;
const latestRelease = await github.rest.repos.getLatestRelease({
owner: 'WildernessLabs',
repo: 'VS_Mac_Meadow_Extension',
});
const commits = await github.rest.repos.listCommits({
owner: 'WildernessLabs',
repo: 'VS_Mac_Meadow_Extension',
since: latestRelease.created_at
});
const messages = commits.data.map(commit => `* ${commit.commit.message}`).join(' \n');
const formattedMessages = `## What's Changed \n${messages}`;
return formattedMessages;
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Create VS2022 Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.MEADOW_MAC_TOKEN }}
with:
owner: WildernessLabs
repo: VS_Mac_Meadow_Extension
tag_name: v${{ ENV.IDE_TOOLS_RELEASE_VERSION }}-vsm${{ ENV.VS_MAC_2022_VERSION }}
release_name: VS Mac VS2022 Extension v${{ ENV.IDE_TOOLS_RELEASE_VERSION }} for Meadow OS v${{ ENV.MEADOW_OS_VERSION }}
body: |
${{ steps.commit_messages.outputs.result }}
draft: true
prerelease: false
commitish: main
# - if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
#- name: Upload Release Asset
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.MEADOW_MAC_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: vs-mac/VS4Mac_Meadow_Extension/bin/Release/net7.0/*.mpack
# asset_name: Meadow.Mac.2022.mpack.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
# asset_content_type: application/zip
build-vscode:
runs-on: windows-latest
needs: [build-and-optionally-publish-nuget]
name: Build VSCode Extension
steps:
- name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
path: Meadow.CLI
- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout VSCode Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VSCode_Meadow_Extension
path: vs-code
submodules: true
ref: main
- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout VSCode Extension side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/VSCode_Meadow_Extension
path: vs-code
submodules: true
- name: Setup .NET Core SDK 6.0.x & 7.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
7.0.x
- name: Setup Nuget
uses: Nuget/[email protected]
- name: Setup Node.js 16
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install NPM
run: |
cd vs-code
npm install
npm update
- name: Install vsce
run: |
npm i -g @vscode/vsce
- name: Add MSBuild to Path
uses: microsoft/[email protected]
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Update VSCode Version Numbers
run: |
$content = Get-Content vs-code/package.json | Out-String
$newcontent = $content -replace '"version": "1.*",', '"version": "${{ENV.IDE_TOOLS_RELEASE_VERSION}}",'
$newcontent | Set-Content vs-code/package.json
- name: Restore VSCode Extension dependencies
run: dotnet restore vs-code/src/csharp/VSCodeMeadow.csproj /p:Configuration=Debug
- name: Build VSCode Extension
id: VSCode-Extension
run: dotnet build vs-code/src/csharp/VSCodeMeadow.csproj /p:Configuration=Debug
- name: Build WebPack
run: |
cd vs-code
npm install -g webpack
npm install -D ts-loader
npm run webpack
- if: ${{ github.ref != 'refs/heads/main' }}
name: Build Pre-Release VSIX on non main branch
run: |
cd vs-code
vsce package --pre-release
- if: ${{ github.ref == 'refs/heads/main' }}
name: Build Release VSIX on main branch
run: |
cd vs-code
vsce package
- name: Upload VSIX Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.VSCode.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'vs-code/*.vsix'
- if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
name: Publish VSCode Extension
run: |
cd vs-code
vsce publish -p ${{ secrets.MARKETPLACE_PUBLISH_PAT }}