-
Notifications
You must be signed in to change notification settings - Fork 137
HVE Core VS Code extension #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
121eb96
9f592a1
1072ee0
91bb04d
997bfc5
f895d63
795aa19
5c40ddd
4278558
781b797
ba00c4c
52a96e1
7201791
f75279b
9d00779
3afb211
00e569b
1c95586
ce38b81
d107152
2fafb4f
bd7e72f
3e9d949
87434af
dd27b51
6fd16bf
a764e3c
95761ca
1bfdf41
820e83f
b431a3a
23a045c
d27c86f
5b76d5b
9739211
c0efa55
e733db4
90f7428
0d778ef
565ef9a
69ded2b
1be761a
78fcc67
97ebc77
ebcd231
83d4d41
c6c21da
aaac54a
5f70b1d
04f70b1
92c0c65
e9b3d85
3edc5ea
36c3826
097dd3a
2ed91c8
bbde877
8f0e53a
d7e6332
bc040d3
88ee417
c48b3f7
6933565
f0f525c
033dcbf
ca0bdf5
995fd9d
d840d5d
0a5180a
6c017b0
0a0f6b5
31129aa
113a58e
937e3cb
96f17e6
4f84353
38a617f
9d29531
51d68e7
b593b17
b6dd674
2c3c22d
c659a7f
68e3a66
3bfe222
4a40c6a
e90c6dd
7c01898
4283a43
7dd0f8d
08a6ba1
b49115e
3903d08
2d2c9ca
4dea6ba
6b8a07b
ea2b5fd
4edf39a
f38e1d5
350f7ec
a649e65
3a02e9c
a7b6a60
67d3097
eb1eabe
9211ed8
217fd05
3fb5922
7f85444
bdfee05
7eaeae0
323a961
bb98e63
2ce2440
e3ec791
40e7641
26b00fe
b342844
e92a84e
dafa2f0
19a59d6
e71786b
27fae33
6d47326
04a151d
140a4e9
f561d8c
e63890c
0d29734
a35ccb2
8377bf1
a772b4a
b9f19a7
51e73a2
fa9916e
afc1140
3577fa6
978b0e7
340c52c
fad6b83
33b31a1
fea19bf
b3164d0
e15acfd
491f87f
6627fd5
5e583b1
76cf581
5168765
e60d2d8
e4dc2c7
331bba9
6d94246
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| name: Package Extension | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| description: 'Full version to use (e.g., 1.0.0 or empty to use package.json)' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| dev-patch-number: | ||
| description: 'Dev patch number to append (creates version like 1.0.0-dev.123)' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| use-changelog: | ||
| description: 'Whether to download and use changelog artifact' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| outputs: | ||
| version: | ||
| description: 'Version that was packaged' | ||
| value: ${{ jobs.package.outputs.version }} | ||
| vsix-file: | ||
| description: 'Path to the packaged VSIX file' | ||
| value: ${{ jobs.package.outputs.vsix-file }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| package: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.package.outputs.version }} | ||
| vsix-file: ${{ steps.package.outputs.vsix-file }} | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install -g @vscode/vsce | ||
|
|
||
| - name: Setup PowerShell | ||
| shell: pwsh | ||
| run: | | ||
| Write-Host "PowerShell version: $($PSVersionTable.PSVersion)" | ||
|
|
||
| - name: Download changelog artifact | ||
| if: inputs.use-changelog | ||
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
| with: | ||
| name: changelog | ||
| path: ./ | ||
| continue-on-error: true | ||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Package extension | ||
| id: package | ||
| shell: pwsh | ||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| run: | | ||
| $version = "${{ inputs.version }}".Trim() | ||
| $devPatch = "${{ inputs.dev-patch-number }}".Trim() | ||
|
|
||
| Write-Host "📦 Packaging extension..." | ||
|
|
||
| $arguments = @() | ||
|
|
||
| if ($version) { | ||
| $arguments += '-Version' | ||
| $arguments += $version | ||
| } | ||
|
|
||
| if ($devPatch) { | ||
| $arguments += '-DevPatchNumber' | ||
| $arguments += $devPatch | ||
| } | ||
|
|
||
| if (Test-Path "./CHANGELOG.md") { | ||
| $arguments += '-ChangelogPath' | ||
| $arguments += "./CHANGELOG.md" | ||
| } | ||
|
|
||
| ./scripts/extension/Package-Extension.ps1 @arguments | ||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Upload VSIX artifact | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: extension-vsix | ||
| path: extension/*.vsix | ||
| retention-days: 30 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| name: Publish Extension | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to publish (leave empty to use package.json version)' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| dry-run: | ||
| description: 'Dry run (package only, do not publish)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| prepare-changelog: | ||
| name: Prepare Changelog | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| changelog-path: ${{ steps.create-changelog.outputs.path }} | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Create changelog file | ||
| id: create-changelog | ||
| run: | | ||
| if [ "${{ github.event_name }}" == "release" ]; then | ||
| cat > CHANGELOG.md << 'EOF' | ||
| ${{ github.event.release.body }} | ||
| EOF | ||
| echo "path=CHANGELOG.md" >> $GITHUB_OUTPUT | ||
| elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
| echo "path=" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "path=" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Upload changelog | ||
| if: steps.create-changelog.outputs.path != '' | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: changelog | ||
| path: CHANGELOG.md | ||
| retention-days: 1 | ||
|
|
||
| normalize-version: | ||
| name: Normalize Version | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| version: ${{ steps.normalize.outputs.version }} | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Normalize version string | ||
| id: normalize | ||
| run: | | ||
| if [ "${{ github.event_name }}" == "release" ]; then | ||
| VERSION="${{ github.event.release.tag_name }}" | ||
| else | ||
| VERSION="${{ inputs.version }}" | ||
| fi | ||
| # Strip leading 'v' if present | ||
| VERSION="${VERSION#v}" | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| package: | ||
| name: Package Extension | ||
| needs: [prepare-changelog, normalize-version] | ||
| uses: ./.github/workflows/extension-package.yml | ||
| with: | ||
| version: ${{ needs.normalize-version.outputs.version }} | ||
| use-changelog: ${{ needs.prepare-changelog.outputs.changelog-path != '' }} | ||
| permissions: | ||
| contents: read | ||
|
|
||
| publish: | ||
| name: Publish to Marketplace | ||
| needs: [prepare-changelog, package] | ||
| if: ${{ !inputs.dry-run }} | ||
| runs-on: ubuntu-latest | ||
| environment: marketplace | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Azure Login (OIDC) | ||
| uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: '20' | ||
|
|
||
| - name: Install VSCE | ||
| run: npm install -g @vscode/vsce | ||
|
|
||
| - name: Download VSIX artifact | ||
| uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
| with: | ||
| name: extension-vsix | ||
| path: ./extension | ||
|
|
||
| - name: Publish to VS Code Marketplace | ||
| run: | | ||
| VSIX_FILE=$(ls -t extension/hve-core-*.vsix | head -1) | ||
| echo "📦 Publishing: $VSIX_FILE" | ||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| vsce publish --packagePath "$VSIX_FILE" --azure-credential | ||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Summary | ||
| run: | | ||
| echo "## 🎉 Extension Published Successfully" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Version:** ${{ needs.package.outputs.version }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "**VSIX File:** ${{ needs.package.outputs.vsix-file }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "View on [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ise-hve-essentials.hve-core)" >> $GITHUB_STEP_SUMMARY | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -4,6 +4,7 @@ on: | |||
| push: | ||||
| branches: | ||||
| - main | ||||
|
|
||||
| workflow_dispatch: | ||||
|
|
||||
| # Minimal permissions for security | ||||
|
|
@@ -46,13 +47,27 @@ jobs: | |||
| upload-sarif: true | ||||
| upload-artifact: true | ||||
|
|
||||
| extension-package: | ||||
| name: Package VS Code Extension | ||||
| needs: | ||||
| - spell-check | ||||
| - markdown-lint | ||||
| - table-format | ||||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| - dependency-pinning-scan | ||||
| uses: ./.github/workflows/extension-package.yml | ||||
| with: | ||||
| dev-patch-number: ${{ github.run_number }} | ||||
| permissions: | ||||
| contents: read | ||||
|
|
||||
| release-please: | ||||
| name: Release Please | ||||
| needs: | ||||
| - spell-check | ||||
| - markdown-lint | ||||
| - table-format | ||||
| - dependency-pinning-scan | ||||
| - extension-package | ||||
|
||||
| - extension-package |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Exclude everything by default | ||
| ** | ||
|
|
||
| # Include only the extension essentials | ||
| !.github/chatmodes/** | ||
| !.github/prompts/** | ||
| !.github/instructions/** | ||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| !.github/agents/** | ||
| !scripts/dev-tools/** | ||
| !package.json | ||
| !README.md | ||
| !LICENSE | ||
| !CHANGELOG.md | ||
eedorenko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # MIT License | ||
|
|
||
| Copyright (c) Microsoft Corporation. All rights reserved. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
Uh oh!
There was an error while loading. Please reload this page.