Skip to content

Commit fe0e16f

Browse files
committed
small fixes
1 parent 49f643d commit fe0e16f

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,20 @@ jobs:
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 \
@@ -95,7 +109,7 @@ jobs:
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

build-rider-plugin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if [ -z "$DOTNET_ONLY" ]; then
4949
fi
5050
if $JAVA_CMD -version 2>&1 | grep -qE 'version "1[7-9]|version "2[0-9]'; then
5151
if [ -f "rider/gradlew" ]; then
52-
if (cd rider && export JAVA_HOME="$JAVA_HOME" && ./gradlew buildPlugin -q); then
52+
if (cd rider && export JAVA_HOME="$JAVA_HOME" && ./gradlew buildPlugin -Pversion="$VERSION" -q); then
5353
KOTLIN_BUILT=1
5454
else
5555
echo " Kotlin build failed. Run: cd rider && ./gradlew buildPlugin"

0 commit comments

Comments
 (0)