-
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (80 loc) · 2.86 KB
/
build-and-test.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
name: Build and Test
on:
pull_request:
branches:
- main
workflow_dispatch:
workflow_call:
env:
EXTENSION_VERSION: 1.0.${{ github.run_number }}
jobs:
# run-tests:
# runs-on: ubuntu-latest
# steps:
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: "8.x"
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# show-progress: false
# - name: Run unit tests
# run: dotnet test ./DocGpt.Test/DocGpt.Test.csproj --configuration Release
# package-extension:
# # VS extension packaging requires netfx, so have to run it on Windows
# runs-on: windows-latest
# steps:
# - name: Setup MSBuild for NetFX
# uses: microsoft/setup-msbuild@v2
# with:
# vs-version: 17.0
# - name: Checkout code
# uses: actions/checkout@v4
# with:
# show-progress: false
# - name: Bump version
# run: |
# # Use PowerShell to update the version in the VSIX manifest
# $xml = [xml](Get-Content -Path .\DocGpt.Vsix\source.extension.vsixmanifest)
# $identityNode = $xml.PackageManifest.Metadata.Identity
# $identityNode.SetAttribute('Version', $env:EXTENSION_VERSION)
# $xml.Save(".\DocGpt.Vsix\source.extension.vsixmanifest")
# echo "extVersion::$env:EXTENSION_VERSION" >> "$GITHUB_OUTPUT"
# - name: Restore NuGet packages
# run: nuget restore .\DocGpt.sln
# - name: Build Extension
# run: msbuild .\DocGpt.sln -p:Configuration=Release
# - name: Store unsigned artifact
# uses: actions/upload-artifact@v4
# with:
# name: DocGPT-unsigned.vsix
# path: DocGpt.Vsix\bin\Release\DocGPT.vsix
sign-extension:
# needs: package-extension
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
show-progress: false
sparse-checkout: |
lib/linux
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: DocGPT-unsigned.vsix
run-id: 9492354653
path: ./DocGPT.vsix
- name: Sign Extension
run: |
ls
ls lib
ls lib/linux
./lib/linux/OpenVsixSignTool sign -h
# run: ./lib/linux/OpenVsixSignTool sign -t "http://timestamp.digicert.com" "./DocGPT.vsix" -kvu "https://${{ secrets.AZURE_KEYVAULT_NAME }}.vault.azure.net" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc "${{ secrets.SIGNING_CERTIFICATE_NAME }}"
# - name: Publish signed artifact
# uses: actions/upload-artifact@v4
# with:
# name: DocGPT-signed.vsix
# path: DocGpt.Vsix\bin\Release\DocGPT.vsix