@@ -47,17 +47,68 @@ jobs:
4747 publish-manifest.json
4848 README.md
4949
50+ build2022 :
51+ name : 🛠️ Build 2022
52+ runs-on : windows-latest
53+ steps :
54+ - name : Checkout
55+ uses : actions/checkout@v6
56+
57+ - name : Setup .NET
58+ uses : actions/setup-dotnet@v5
59+ with :
60+ dotnet-version : ${{ env.dotnetVersion }}.x
61+
62+ - name : Restore/Build/Test
63+ run : dotnet test
64+
65+ - name : Update Vsix DisplayName and Id
66+ run : |
67+ [xml]$vsixXml = Get-Content ${{ inputs.manifest-file }}
68+
69+ $ns = New-Object System.Xml.XmlNamespaceManager $vsixXml.NameTable
70+ $ns.AddNamespace("ns", $vsixXml.DocumentElement.NamespaceURI) | Out-Null
71+
72+ $attrId = $vsixXml.SelectSingleNode("//ns:Identity", $ns).Attributes["Id"]
73+ $attrId.InnerText = "dcdbcca4-3a88-432f-ba04-eb4a4cb64437"
74+
75+ $nodeDisplayName = $vsixXml.SelectSingleNode("//ns:DisplayName", $ns)
76+ $nodeDisplayName.InnerText = "CodeNav 2022"
77+
78+ $vsixXml.Save("${{ inputs.manifest-file }}") | Out-Null
79+
80+ - name : Update Vsix Manifest Version
81+ id : vsix_version
82+ uses : timheuer/vsix-version-stamp@v2
83+ with :
84+ version-number : ${{ env.version }}
85+ manifest-file : src/CodeNav/source.extension.vsixmanifest
86+
87+ - name : Build VSIX
88+ run : dotnet publish src/CodeNav -p:Version=${{ env.version }} -c Release
89+
90+ - name : Publish Build Artifacts
91+ uses : actions/upload-artifact@v7
92+ with :
93+ name : CodeNav2022
94+ path : |
95+ ${{ env.vsixPath }}
96+ publish-manifest.json
97+ README.md
98+
5099 release :
51100 if : github.ref_name == 'main'
52- name : 🚀 Release
53- needs : build
101+ name : 🚚 Release
102+ needs : [ build, build2022]
54103 runs-on : windows-latest
55104 environment : Release
56105 permissions :
57106 contents : write
58107 steps :
59108 - name : Download artifact
60109 uses : actions/download-artifact@v8
110+ with :
111+ name : CodeNav
61112
62113 - name : Tag release
63114 id : tag_release
@@ -75,15 +126,35 @@ jobs:
75126 artifacts : ${{ env.vsixPath }}
76127 skipIfReleaseExists : true
77128
129+ publish :
130+ if : github.ref_name == 'main'
131+ name : 🚀 Publish
132+ needs : release
133+ runs-on : windows-latest
134+ environment : Release
135+ permissions :
136+ contents : write
137+ steps :
138+ - name : Download artifact
139+ uses : actions/download-artifact@v8
140+
78141 - name : Publish to Marketplace
79142 run : >
80143 & 'C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VSSDK/VisualStudioIntegration/Tools/Bin/VsixPublisher.exe'
81144 publish
82145 -personalAccessToken ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}
83- -payload ${{ env.vsixPath }}
84- -publishManifest publish-manifest.json
146+ -payload CodeNav/${{ env.vsixPath }}
147+ -publishManifest CodeNav/publish-manifest.json
148+
149+ - name : Publish to Marketplace 2022
150+ run : >
151+ & 'C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VSSDK/VisualStudioIntegration/Tools/Bin/VsixPublisher.exe'
152+ publish
153+ -personalAccessToken ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}
154+ -payload CodeNav2022/${{ env.vsixPath }}
155+ -publishManifest CodeNav2022/publish-manifest.json
85156
86157 - name : Publish to Open VSIX Gallery
87158 uses : timheuer/openvsixpublish@v1
88159 with :
89- vsix-file : ${{ env.vsixPath }}
160+ vsix-file : CodeNav/ ${{ env.vsixPath }}
0 commit comments