Skip to content

Commit 9bfe63e

Browse files
committed
Build Redevelopment Workflow
1 parent 90b34b4 commit 9bfe63e

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Build Redevelopment
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- Redevelopment
9+
10+
workflow_call:
11+
outputs:
12+
version:
13+
value: ${{ jobs.build.outputs.version }}
14+
15+
jobs:
16+
build:
17+
runs-on: windows-2019
18+
19+
outputs:
20+
version: ${{ steps.version.outputs.version }}
21+
22+
steps:
23+
- name: Checkup code
24+
uses: actions/[email protected]
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup NuGet
29+
uses: nuget/setup-nuget@v2
30+
31+
- name: Setup MSBuild
32+
uses: microsoft/setup-msbuild@v2
33+
34+
- name: Search and increment last version
35+
id: version
36+
run: |
37+
$latestTag = git tag --list 'v*' | Where-Object { $_ -match '^v[0-9]+\.[0-9]+\.[0-9]+$' } | Sort-Object { [Version]($_.TrimStart('v')) } | Select-Object -Last 1
38+
$oldVersion = $latestTag.TrimStart('v')
39+
$versionParts = $oldVersion -split '\.'
40+
$versionParts[2] = [int]$versionParts[2] + 1
41+
$newVersion = "$($versionParts -join '.')"
42+
echo version=$newVersion >> $env:GITHUB_OUTPUT
43+
44+
- name: Set extension manifest versions
45+
shell: pwsh
46+
run: |
47+
$paths = @(
48+
"src\ExtensionManager.Vsix.VS2017\source.extension.vsixmanifest",
49+
"src\ExtensionManager.Vsix.VS2019\source.extension.vsixmanifest",
50+
"src\ExtensionManager.Vsix.VS2022\source.extension.vsixmanifest",
51+
"src\ExtensionManager.Vsix.VS2017\source.extension.cs",
52+
"src\ExtensionManager.Vsix.VS2019\source.extension.cs",
53+
"src\ExtensionManager.Vsix.VS2022\source.extension.cs"
54+
)
55+
foreach ($path in $paths) {
56+
(Get-Content -Path $path) -Replace '1.2.9999', '${{ steps.version.outputs.version }}' | Set-Content -Path $path
57+
}
58+
59+
- name: NuGet Restore
60+
run: nuget restore
61+
62+
- name: Run build
63+
run: msbuild ExtensionManager.sln /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m
64+
65+
- name: Archive VSIX 2017
66+
uses: actions/upload-artifact@v3
67+
with:
68+
name: ExtensionManager2017.vsix
69+
path: src/ExtensionManager.Vsix.VS2017/bin/Release/ExtensionManager.Vsix.VS2017.vsix
70+
71+
- name: Archive VSIX 2019
72+
uses: actions/upload-artifact@v3
73+
with:
74+
name: ExtensionManager2019.vsix
75+
path: src/ExtensionManager.Vsix.VS2019/bin/Release/ExtensionManager.Vsix.VS2019.vsix
76+
77+
- name: Archive VSIX 2022
78+
uses: actions/upload-artifact@v3
79+
with:
80+
name: ExtensionManager2022.vsix
81+
path: src/ExtensionManager.Vsix.VS2022/bin/Release/ExtensionManager.Vsix.VS2022.vsix

ExtensionManager.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{431E
5050
EndProject
5151
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{5C6EB350-6BEE-4D5A-B02F-7B331D6D8FE8}"
5252
ProjectSection(SolutionItems) = preProject
53+
.github\workflows\Build Redevelopment.yml = .github\workflows\Build Redevelopment.yml
5354
.github\workflows\Build.yml = .github\workflows\Build.yml
5455
.github\workflows\Release.yml = .github\workflows\Release.yml
5556
EndProjectSection

0 commit comments

Comments
 (0)