Skip to content

Commit 20a7d56

Browse files
authored
chore: update GH actions (#308)
1 parent ebaa8cf commit 20a7d56

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

.github/actions/next-git-tag/patch-manifest.ps1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,29 @@ Param(
77
[Parameter(Mandatory = $true)]
88
[string]$ManifestPath, # Path to extension.vsixmanifest
99
[Parameter(Mandatory = $true)]
10-
[string]$PipelineType # Type of pipeline: "preview" or "stable"
10+
[string]$PipelineType, # Type of pipeline: "preview" or "stable"
11+
[Parameter(Mandatory = $true)]
12+
[string]$Version # Extension Version
1113
)
1214

1315
# Load the XML file
1416
[xml]$xml = Get-Content -Path $ManifestPath
1517

1618
# Check the pipeline type, and if it's a release, modify the DisplayName
1719
if ($PipelineType -eq "preview") {
18-
Write-Host "Pipeline is release, appending 'preview' to DisplayName."
20+
Write-Host "Pipeline is release, setting 'preview' to DisplayName."
1921
$displayNameNode = $xml.PackageManifest.Metadata.DisplayName
20-
# Append ' preview' to the existing DisplayName
22+
# Append 'preview' to the existing DisplayName
2123
$displayNameNode = "(Preview) $displayNameNode"
2224
$xml.PackageManifest.Metadata.DisplayName = $displayNameNode
2325
$xml.PackageManifest.Metadata.Preview = "true"
2426
$xml.PackageManifest.Metadata.Identity.SetAttribute("Id", "snyk_visual_studio_plugin_2022_preview.27b810bb-3e15-4b77-8866-e8ea515a6ee6")
2527
Write-Host "Updated DisplayName: $displayNameNode"
2628
Write-Host "Updated Preview: true"
2729
# Save the modified XML back to the file
28-
$xml.Save($ManifestPath)
29-
Write-Host "Manifest file has been updated successfully."
30-
} else {
31-
Write-Host "Pipeline is not preview, no changes made to DisplayName."
3230
}
31+
32+
$xml.PackageManifest.Metadata.Identity.SetAttribute("Version", $Version)
33+
Write-Host "Updated Version to: $Version"
34+
$xml.Save($ManifestPath)
35+
Write-Host "Manifest file has been updated successfully."

.github/workflows/build-project.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ jobs:
2727
with:
2828
fetch-depth: 0
2929

30-
- name: Patch Name for vsix manifest file
31-
id: patch_vsix
32-
shell: pwsh
33-
run: |
34-
& ".\.github\actions\next-git-tag\patch-manifest.ps1" ".\Snyk.VisualStudio.Extension.2022\source.extension.vsixmanifest" "${{ inputs.channel }}"
35-
3630
- name: Calculate next semantic version
3731
shell: pwsh
3832
id: vsix_version
@@ -44,11 +38,11 @@ jobs:
4438
& ".\.github\actions\next-git-tag\next-git-tag.ps1" time
4539
}
4640
47-
- name: Set VSIX version for 2022
48-
uses: cezarypiatek/[email protected]
49-
with:
50-
version: ${{ steps.vsix_version.outputs.next-tag }}
51-
vsix-manifest-file: .\Snyk.VisualStudio.Extension.2022\source.extension.vsixmanifest
41+
- name: Patch vsix manifest file
42+
id: patch_vsix
43+
shell: pwsh
44+
run: |
45+
& ".\.github\actions\next-git-tag\patch-manifest.ps1" ".\Snyk.VisualStudio.Extension.2022\source.extension.vsixmanifest" "${{ inputs.channel }}" "${{ steps.vsix_version.outputs.next-tag }}"
5246
5347
- name: Check if secrets exist
5448
env:

.github/workflows/release-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
git push origin main --tags
7474
7575
- name: Publish 2022 extension to Marketplace
76-
uses: cezarypiatek/VsixPublisherAction@0.2
76+
uses: cezarypiatek/VsixPublisherAction@1.1
7777
with:
7878
extension-file: '.\Snyk.VisualStudio.Extension.2022\bin\Release\Snyk.VisualStudio.Extension.vsix'
7979
publish-manifest-file: '.\Snyk.VisualStudio.Extension.2022\vs-publish-preview.json'

0 commit comments

Comments
 (0)