-
Notifications
You must be signed in to change notification settings - Fork 6
102 lines (84 loc) · 3.03 KB
/
Copy pathdotnet.yml
File metadata and controls
102 lines (84 loc) · 3.03 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
workflow_dispatch:
inputs:
is_release:
description: 'Should the deploy action be ran'
required: false
default: false
type: boolean
push:
branches: [ "main" ]
paths-ignore:
- '**/Readme.md'
- '**/GifInstruction/'
- '**/.gitignore'
- '**/.editorconfig'
- 'workflows/dotnet.yml'
pull_request:
branches: [ "main" ]
release:
types:
- published # Run the workflow when a new GitHub release is published
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
VisxDirectory: ${{github.workspace}}/vsix
Version: '3.0.0.${{ github.run_number }}'
BaseVersion: '3.0.0.0'
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: [windows-latest]
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
- name: Setup MsBuild
uses: microsoft/setup-msbuild@v2
- name: Setup VSTest.console.exe
# You may pin to the exact commit or the version.
# uses: darenm/Setup-VSTest@d9a5dffa3f11d9c27ec42eb69515d3aaeaad9ef8
uses: darenm/Setup-VSTest@v1.2
- name: Setup NuGet.exe
# You may pin to the exact commit or the version.
# uses: NuGet/setup-nuget@296fd3ccf8528660c91106efefe2364482f86d6f
uses: NuGet/setup-nuget@v2.0.0
- name: Update Visual Studio Extension version (vs2026)
uses: cezarypiatek/VsixVersionAction@1.2
with:
version: ${{ env.Version }}
vsix-manifest-file: 'CodeDocumentor2026\source.extension.vsixmanifest'
- name: Restore dependencies
run: nuget restore CodeDocumentor.sln
- name: Build
run: msbuild CodeDocumentor.sln /p:configuration="Release" /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal
- name: Test
run: vstest.console.exe CodeDocumentor.Test\bin\Release\net48\CodeDocumentor.Test.dll
- uses: actions/upload-artifact@v4.3.1
name: "Pack vs2026"
with:
name: "CodeDocumentor2026.vsix"
path: CodeDocumentor2026\bin\Release\CodeDocumentor2026.vsix
deploy:
# Publish only when creating a GitHub Release
# https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
if: github.event_name == 'release' || github.event.inputs.is_release == true
runs-on: [windows-latest]
needs: [ build ]
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v4.1.2
with:
name: "CodeDocumentor2026.vsix"
path: '.'
- name: Publish extension to Marketplace
uses: cezarypiatek/VsixPublisherAction@1.1
with:
extension-file: 'CodeDocumentor2026.vsix'
publish-manifest-file: 'CodeDocumentor2026\publishManifest.json'
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}