File tree Expand file tree Collapse file tree 7 files changed +88
-57
lines changed
Expand file tree Collapse file tree 7 files changed +88
-57
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Visual Studio 2022 Extension
2+
3+ on : workflow_dispatch
4+
5+ jobs :
6+ publish-visual-studio :
7+ runs-on : windows-2022
8+
9+ env :
10+ Configuration : Release
11+ DeployExtension : false
12+
13+ steps :
14+ - name : Checkout
15+ uses : actions/checkout@v2
16+
17+ - name : Setup MSBuild
18+ uses : microsoft/setup-msbuild@v1.0.2
19+
20+ - name : Publish
21+ working-directory : ./visual-studio
22+ run : msbuild /t:PublishToMarketplace /Restore /v:Minimal /p:Configuration=Release /p:PersonalAccessToken=${{ secrets.PUBLISHER_TOKEN }}
Original file line number Diff line number Diff line change @@ -26,27 +26,27 @@ jobs:
2626 PUBLISHER_TOKEN : ${{ secrets.PUBLISHER_TOKEN }}
2727 run : node_modules/.bin/vsce publish -p $PUBLISHER_TOKEN
2828
29- publish-visual-studio :
30- runs-on : windows-2022
31-
32- env :
33- Configuration : Release
34- DeployExtension : false
35-
36- steps :
37- - name : Checkout
38- uses : actions/checkout@v2
39-
40- - name : Setup MSBuild
41- uses : microsoft/setup-msbuild@v1.0.2
42-
43- - name : Build
44- working-directory : ./visual-studio
45- run : msbuild /t:Rebuild /Restore /v:Minimal
46-
47- - name : Publish
48- uses : cezarypiatek/VsixPublisherAction@0.2
49- with :
50- extension-file : visual-studio\source\GitWebLinks\bin\Release\GitWebLinks.vsix
51- publish-manifest-file : visual-studio\publish.json
52- personal-access-code : ${{ secrets.PUBLISHER_TOKEN }}
29+ # publish-visual-studio:
30+ # runs-on: windows-2022
31+
32+ # env:
33+ # Configuration: Release
34+ # DeployExtension: false
35+
36+ # steps:
37+ # - name: Checkout
38+ # uses: actions/checkout@v2
39+
40+ # - name: Setup MSBuild
41+ # uses: microsoft/setup-msbuild@v1.0.2
42+
43+ # - name: Build
44+ # working-directory: ./visual-studio
45+ # run: msbuild /t:Rebuild /Restore /v:Minimal
46+
47+ # - name: Publish
48+ # uses: cezarypiatek/VsixPublisherAction@0.2
49+ # with:
50+ # extension-file: visual-studio\source\GitWebLinks\bin\Release\GitWebLinks.vsix
51+ # publish-manifest-file: visual-studio\publish.json
52+ # personal-access-code: ${{ secrets.PUBLISHER_TOKEN }}
Original file line number Diff line number Diff line change 4343}
4444
4545Write-Host " Updating Visual Studio extension..."
46+ # Set the version in the props file.
4647$manifestFileName = Join-Path $root - ChildPath " visual-studio/source/GitWebLinks/source.extension.vsixmanifest"
4748$manifest = New-Object - TypeName System.Xml.XmlDocument
4849$manifest.PreserveWhitespace = $true
@@ -52,9 +53,16 @@ $identity = Select-Xml -Xml $manifest -XPath "/x:PackageManifest/x:Metadata/x:Id
5253([System.Xml.XmlElement ]$identity.Node ).SetAttribute(" Version" , $new.ToString ())
5354$manifest.Save ($manifestFileName )
5455
56+ # Set the version in the manifest's generated code-behind file.
5557$codeFileName = Join-Path - Path $root - ChildPath " visual-studio/source/GitWebLinks/source.extension.cs"
5658$code = Get-Content - Path $codeFileName - Raw
5759$code = $code -replace " public const string Version = `" [\d.]+`" ;" , " public const string Version = `" $ ( $new.ToString ()) `" ;"
5860Set-Content - Path $codeFileName - Value $code - NoNewLine
5961
62+ # Set the version in the assembly info.
63+ $assemblyInfoFileName = Join-Path - Path $root - ChildPath " visual-studio/source/GitWebLinks/Properties/AssemblyInfo.cs"
64+ $assemblyInfo = Get-Content - Path $assemblyInfoFileName - Raw
65+ $assemblyInfo = $assemblyInfo -replace " Version\(`" [\d.]+`" \)" , " Version(`" $ ( $new.ToString ()) .0`" )"
66+ Set-Content - Path $assemblyInfoFileName - Value $assemblyInfo - NoNewLine
67+
6068Write-Host " Done"
Original file line number Diff line number Diff line change 1+ <Project >
2+ <ItemGroup >
3+ <PackageReference Update =" Microsoft.VSSDK.BuildTools" >
4+ <GeneratePathProperty >true</GeneratePathProperty >
5+ </PackageReference >
6+ </ItemGroup >
7+
8+ <Target Name =" PublishToMarketplace" DependsOnTargets =" Rebuild" >
9+ <Message Text =" Publishing extension to the marketplace..." Importance =" high" />
10+
11+ <Error
12+ Condition =" '$(Configuration)' != 'Release'"
13+ Text =" The configuration must be 'Release' when publishing to the marketplace."
14+ />
15+
16+ <PropertyGroup >
17+ <VsixPublisher >$(PkgMicrosoft_VSSDK_BuildTools)\tools\vssdk\bin\VsixPublisher.exe</VsixPublisher >
18+ <PublishManifestFileName >$(MSBuildThisFileDirectory)..\publish.json</PublishManifestFileName >
19+ <ExtensionFileName >$(ProjectDir)$(TargetVsixContainer)</ExtensionFileName >
20+ </PropertyGroup >
21+
22+ <Exec
23+ Command =" $(VsixPublisher) publish -personalAccessToken $(PersonalAccessToken) -payload $(ExtensionFileName) -publishManifest $(PublishManifestFileName)"
24+ StandardOutputImportance =" high"
25+ StandardErrorImportance =" high"
26+ LogStandardErrorAsError =" true"
27+ />
28+
29+ <Message Text =" Finished publishing." Importance =" high" />
30+ </Target >
31+ </Project >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 254254 </ItemGroup >
255255 <Import Project =" $(MSBuildToolsPath)\Microsoft.CSharp.targets" />
256256 <Import Project =" $(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition =" '$(VSToolsPath)' != ''" />
257- <Import Project =" $(MSBuildThisFileDirectory)..\..\build\SetVsixVersion .targets" />
257+ <Import Project =" $(MSBuildThisFileDirectory)..\..\build\PublishToMarketplace .targets" />
258258</Project >
Original file line number Diff line number Diff line change 1313[ assembly: AssemblyCulture ( "" ) ]
1414[ assembly: ComVisible ( false ) ]
1515[ assembly: NeutralResourcesLanguage ( "en-US" ) ]
16- [ assembly: AssemblyVersion ( "1.0.0 .0" ) ]
17- [ assembly: AssemblyFileVersion ( "1.0.0 .0" ) ]
16+ [ assembly: AssemblyVersion ( "2.6.1 .0" ) ]
17+ [ assembly: AssemblyFileVersion ( "2.6.1 .0" ) ]
1818[ assembly: ThemeInfo ( ResourceDictionaryLocation . None , ResourceDictionaryLocation . SourceAssembly ) ]
You can’t perform that action at this time.
0 commit comments