8585 env :
8686 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
8787
88+ - name : Increment VSIX version
89+ if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
90+ run : |
91+ $manifest = "src/TypeScriptDefinitionGenerator/source.extension.vsixmanifest"
92+ $csFile = "src/TypeScriptDefinitionGenerator/source.extension.cs"
93+ $vsixVersion = "${{ env.assemblySemVer }}"
94+ [xml]$xml = Get-Content $manifest
95+ $ns = New-Object System.Xml.XmlNamespaceManager $xml.NameTable
96+ $ns.AddNamespace("ns", $xml.DocumentElement.NamespaceURI) | Out-Null
97+ $xml.SelectSingleNode("//ns:Identity", $ns).Attributes["Version"].Value = $vsixVersion
98+ $xml.Save($manifest)
99+ (Get-Content $csFile) -replace 'Version = "[^"]*"', "Version = `"$vsixVersion`"" | Set-Content $csFile
100+ echo "VERSION=$vsixVersion" >> $env:GITHUB_ENV
101+
88102 - name : Build VSIX
89103 run : >
90104 msbuild $env:SOLUTION \
95109 /v:m
96110
97111 - name : Build Rider plugin
98- run : bash build-rider-plugin.sh $env:BUILD_CONFIG ${GitVersion_InformationalVersion}
112+ run : bash build-rider-plugin.sh $env:BUILD_CONFIG "${{ env.semVer }}"
99113
100114 - name : ref
101115 run : echo "github.head_ref 1 ${{ github.head_ref }} 2 $GITHUB_REF 3 ${{ github.ref }}"
@@ -128,7 +142,7 @@ jobs:
128142
129143 - name : Publish to marketplaces
130144 if : github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
131- run : ./publish-marketplace.ps1
145+ run : ./publish-marketplace.ps1 -RiderZipPath "output\TypeScriptDefinitionGenerator.Rider-${{ env.semVer }}.zip"
132146 env :
133147 VS_MARKETPLACE_PAT : ${{ secrets.VS_MARKETPLACE_PAT }}
134148 JETBRAINS_MARKETPLACE_TOKEN : ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }}
@@ -138,7 +152,7 @@ jobs:
138152 New-Item -ItemType Directory -Path artifacts -Force
139153 $vsix = Get-ChildItem -Path . -Filter "*.vsix" -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.FullName -like "*TypeScriptDefinitionGenerator*" -and $_.FullName -notlike "*obj*" } | Select-Object -First 1
140154 if ($vsix) { Copy-Item $vsix.FullName -Destination "artifacts/TypeScriptDefinitionGenerator.vsix" -Force }
141- if (Test-Path "output/TypeScriptDefinitionGenerator.Rider-${GitVersion_InformationalVersion} .zip") { Copy-Item "output/TypeScriptDefinitionGenerator.Rider-${GitVersion_InformationalVersion }.zip" -Destination "artifacts/" -Force }
155+ if (Test-Path "output/TypeScriptDefinitionGenerator.Rider-${{ env.semVer }} .zip") { Copy-Item "output/TypeScriptDefinitionGenerator.Rider-${{ env.semVer } }.zip" -Destination "artifacts/" -Force }
142156
143157 - name : Upload artifacts
144158 uses : actions/upload-artifact@v4
0 commit comments