microsoft/hve-core

Public

mirrored from https://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
docs/227-add-governance

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/extension-package.yml

118lines · modecode

1name: Package Extension
2
3on:
4 workflow_call:
5 inputs:
6 version:
7 description: 'Full version to use (e.g., 1.0.0 or empty to use package.json)'
8 required: false
9 type: string
10 default: ''
11 dev-patch-number:
12 description: 'Dev patch number to append (creates version like 1.0.0-dev.123)'
13 required: false
14 type: string
15 default: ''
16 use-changelog:
17 description: 'Whether to download and use changelog artifact'
18 required: false
19 type: boolean
20 default: false
21 channel:
22 description: 'Release channel (Stable or PreRelease) controlling agent maturity filtering'
23 required: false
24 type: string
25 default: 'Stable'
26 outputs:
27 version:
28 description: 'Version that was packaged'
29 value: ${{ jobs.package.outputs.version }}
30 vsix-file:
31 description: 'Path to the packaged VSIX file'
32 value: ${{ jobs.package.outputs.vsix-file }}
33
34permissions:
35 contents: read
36
37jobs:
38 package:
39 runs-on: ubuntu-latest
40 permissions:
41 contents: read
42 outputs:
43 version: ${{ steps.package.outputs.version }}
44 vsix-file: ${{ steps.package.outputs.vsix-file }}
45 steps:
46 - name: Harden Runner
47 uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
48 with:
49 egress-policy: audit
50
51 - name: Checkout code
52 uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
53 with:
54 persist-credentials: false
55
56 - name: Setup Node.js
57 uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
58 with:
59 node-version: '20'
60
61 - name: Install dependencies
62 run: npm install -g @vscode/vsce@3.7.1
63
64 - name: Setup PowerShell
65 shell: pwsh
66 run: |
67 Write-Host "PowerShell version: $($PSVersionTable.PSVersion)"
68 Install-Module -Name PowerShell-Yaml -Force -Scope CurrentUser
69
70 - name: Download changelog artifact
71 if: inputs.use-changelog
72 uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
73 with:
74 name: changelog
75 path: ./
76 continue-on-error: true
77
78 - name: Prepare extension resources
79 id: prepare
80 shell: pwsh
81 run: |
82 $channel = "${{ inputs.channel }}".Trim()
83 if (-not $channel) { $channel = 'Stable' }
84
85 Write-Host "🔧 Preparing extension for $channel channel..."
86 ./scripts/extension/Prepare-Extension.ps1 -Channel $channel
87
88 - name: Package extension
89 id: package
90 shell: pwsh
91 run: |
92 $version = "${{ inputs.version }}".Trim()
93 $devPatch = "${{ inputs.dev-patch-number }}".Trim()
94
95 Write-Host "📦 Packaging extension..."
96
97 $arguments = @{}
98
99 if ($version) {
100 $arguments['Version'] = $version
101 }
102
103 if ($devPatch) {
104 $arguments['DevPatchNumber'] = $devPatch
105 }
106
107 if (Test-Path "./CHANGELOG.md") {
108 $arguments['ChangelogPath'] = "./CHANGELOG.md"
109 }
110
111 ./scripts/extension/Package-Extension.ps1 @arguments
112
113 - name: Upload VSIX artifact
114 uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
115 with:
116 name: extension-vsix
117 path: extension/*.vsix
118 retention-days: 30
119