-
Notifications
You must be signed in to change notification settings - Fork 9
154 lines (127 loc) · 5.68 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
name: VS4Win Extension
env:
IDE_TOOLS_RELEASE_VERSION: 1.1.2
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
build-2019:
runs-on: windows-2019
name: Build VS2019 Extension
steps:
- name: Checkout current repo
uses: actions/checkout@v2
with:
path: main
- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: main
- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: develop
- name: Setup .NET Core SDK 5.0.x and 6.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
5.0.x
6.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: msbuild main/VS_Meadow_Extension.2019.sln /t:Restore /p:Configuration=Release
- name: Build VS2019 Extension
id: VS2019-Extension
run: msbuild main/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 VSIX Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Win.VS2019.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'main\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-2022:
runs-on: windows-2022
name: Build VS2022 Extension
steps:
- name: Checkout current repo
uses: actions/checkout@v2
with:
path: main
- if: ${{ github.ref == 'refs/heads/main' }}
name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: main
- if: ${{ github.ref != 'refs/heads/main' }}
name: Checkout Meadow.CLI.Core side-by-side
uses: actions/checkout@v2
with:
repository: WildernessLabs/Meadow.CLI
path: Meadow.CLI
ref: develop
- name: Setup .NET Core SDK 5.0.x and 6.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: msbuild main/VS_Meadow_Extension.2022.sln /t:Restore /p:Configuration=Release
- name: Build VS2022 Extension
id: VS2022-Extension
run: msbuild main/VS_Meadow_Extension.2022.sln /t:Rebuild /p:Configuration=Release
env:
DevEnvDir: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE'
- name: Upload VSIX Artifacts
uses: actions/upload-artifact@v2
with:
name: Meadow.Win.VS2022.vsix.${{ ENV.IDE_TOOLS_RELEASE_VERSION }}
path: 'main\VS_Meadow_Extension\VS_Meadow_Extension.2022\bin\Release\*.vsix'
# - uses: actions/create-release@v1
# id: create_vs2022_release
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: ${{ github.ref }}
- 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}}"