-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (68 loc) · 2.5 KB
/
release.yml
File metadata and controls
82 lines (68 loc) · 2.5 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
name: Release VSIX Extension
on:
push:
branches: [ "release" ]
pull_request:
branches: [ "release" ]
workflow_dispatch: # Allows manual trigger
jobs:
build:
runs-on: windows-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Restore NuGet Packages
run: nuget restore DebugAttachHistory.sln
- name: Install Visual Studio Build Tools
run: |
choco install visualstudio2022buildtools --params "--add Microsoft.VisualStudio.Component.VSSDK"
- name: Locate MSBuild
id: locate-msbuild
run: |
$msbuildPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
echo "MSBUILD_EXE=$msbuildPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
- name: Build Solution
run: |
&"$env:MSBUILD_EXE" DebugAttachHistory.sln /p:Configuration=Release /p:Platform="Any CPU" /p:DeployExtension=false /m
- name: Find VSIX File
id: find-vsix
run: |
$vsixFile = Get-ChildItem -Path . -Recurse -Filter "*.vsix" | Select-Object -ExpandProperty FullName
echo $vsixFile
echo "VSIX_PATH=$vsixFile" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8
shell: pwsh
- name: Upload VSIX as Artifact
uses: actions/upload-artifact@v4
with:
name: VSIX-Package
path: ${{ env.VSIX_PATH }}
- name: Extract Extension Version
id: get_version
run: |
[xml]$xml = Get-Content "DebugAttachHistory/source.extension.vsixmanifest"
$version = $xml.PackageManifest.Metadata.Identity.Version
echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8
shell: pwsh
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download VSIX Artifact
uses: actions/download-artifact@v4
with:
name: VSIX-Package
path: .
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: "*.vsix"
tag_name: v${{ needs.build.outputs.VERSION }}
name: v${{ needs.build.outputs.VERSION }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}