diff --git a/.github/actions/next-git-tag/patch-manifest.ps1 b/.github/actions/next-git-tag/patch-manifest.ps1 index db02e289..42036f58 100644 --- a/.github/actions/next-git-tag/patch-manifest.ps1 +++ b/.github/actions/next-git-tag/patch-manifest.ps1 @@ -7,7 +7,9 @@ Param( [Parameter(Mandatory = $true)] [string]$ManifestPath, # Path to extension.vsixmanifest [Parameter(Mandatory = $true)] - [string]$PipelineType # Type of pipeline: "preview" or "stable" + [string]$PipelineType, # Type of pipeline: "preview" or "stable" + [Parameter(Mandatory = $true)] + [string]$Version # Extension Version ) # Load the XML file @@ -15,9 +17,9 @@ Param( # Check the pipeline type, and if it's a release, modify the DisplayName if ($PipelineType -eq "preview") { - Write-Host "Pipeline is release, appending 'preview' to DisplayName." + Write-Host "Pipeline is release, setting 'preview' to DisplayName." $displayNameNode = $xml.PackageManifest.Metadata.DisplayName - # Append ' preview' to the existing DisplayName + # Append 'preview' to the existing DisplayName $displayNameNode = "(Preview) $displayNameNode" $xml.PackageManifest.Metadata.DisplayName = $displayNameNode $xml.PackageManifest.Metadata.Preview = "true" @@ -25,8 +27,9 @@ if ($PipelineType -eq "preview") { Write-Host "Updated DisplayName: $displayNameNode" Write-Host "Updated Preview: true" # Save the modified XML back to the file - $xml.Save($ManifestPath) - Write-Host "Manifest file has been updated successfully." -} else { - Write-Host "Pipeline is not preview, no changes made to DisplayName." } + +$xml.PackageManifest.Metadata.Identity.SetAttribute("Version", $Version) +Write-Host "Updated Version to: $Version" +$xml.Save($ManifestPath) +Write-Host "Manifest file has been updated successfully." \ No newline at end of file diff --git a/.github/workflows/build-project.yml b/.github/workflows/build-project.yml index 8cbac9d2..bb9f1483 100644 --- a/.github/workflows/build-project.yml +++ b/.github/workflows/build-project.yml @@ -27,12 +27,6 @@ jobs: with: fetch-depth: 0 - - name: Patch Name for vsix manifest file - id: patch_vsix - shell: pwsh - run: | - & ".\.github\actions\next-git-tag\patch-manifest.ps1" ".\Snyk.VisualStudio.Extension.2022\source.extension.vsixmanifest" "${{ inputs.channel }}" - - name: Calculate next semantic version shell: pwsh id: vsix_version @@ -44,11 +38,11 @@ jobs: & ".\.github\actions\next-git-tag\next-git-tag.ps1" time } - - name: Set VSIX version for 2022 - uses: cezarypiatek/VsixVersionAction@1.0 - with: - version: ${{ steps.vsix_version.outputs.next-tag }} - vsix-manifest-file: .\Snyk.VisualStudio.Extension.2022\source.extension.vsixmanifest + - name: Patch vsix manifest file + id: patch_vsix + shell: pwsh + run: | + & ".\.github\actions\next-git-tag\patch-manifest.ps1" ".\Snyk.VisualStudio.Extension.2022\source.extension.vsixmanifest" "${{ inputs.channel }}" "${{ steps.vsix_version.outputs.next-tag }}" - name: Check if secrets exist env: diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml index 1c953eb9..39cb55fb 100644 --- a/.github/workflows/release-preview.yml +++ b/.github/workflows/release-preview.yml @@ -73,7 +73,7 @@ jobs: git push origin main --tags - name: Publish 2022 extension to Marketplace - uses: cezarypiatek/VsixPublisherAction@0.2 + uses: cezarypiatek/VsixPublisherAction@1.1 with: extension-file: '.\Snyk.VisualStudio.Extension.2022\bin\Release\Snyk.VisualStudio.Extension.vsix' publish-manifest-file: '.\Snyk.VisualStudio.Extension.2022\vs-publish-preview.json'