Skip to content

Commit 9690196

Browse files
committed
feat(release): ✨ Add Create Release workflow and enhance CI task
* Introduced `CreateRelease.yaml` for automated release creation. * Updated `Publish.yaml` to restrict tag pattern to "v*". * Enhanced CI task in `psake.ps1` to output VSIX version.
1 parent e85d507 commit 9690196

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create Release
2+
on:
3+
workflow_dispatch:
4+
jobs:
5+
package:
6+
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: 20
13+
- run: yarn package
14+
- name: Get Release Details
15+
id: release_details
16+
shell: pwsh
17+
run: |
18+
# TODO: Get latest release number
19+
.\build.ps1 -Task CI
20+
# Outputs:
21+
# vsix_path
22+
# vsix_name
23+
# changelog_title
24+
# changelog_body
25+
- name: Create a Release
26+
uses: softprops/action-gh-release@v2
27+
with:
28+
name: ${{ steps.release_details.outputs.vsix_name }}
29+
body: ${{ steps.release_details.outputs.changelog_body }}
30+
files: ${{ steps.release_details.outputs.vsix_path }}
31+
make_latest: true
32+
tag_name: ${{ steps.release_details.outputs.vsix_version }}

.github/workflows/Publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
tags:
4-
- "*"
4+
- "v*"
55

66
name: Deploy Extension
77
jobs:

psake.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ Task CI -Depends Package {
127127
Add-Content -Path $outputFile -Value "vsix_name=$($vsixFiles[0].Name)"
128128
Write-Host "::notice::VSIX path: $vsixFile"
129129
Write-Host "::notice::VSIX name: $($vsixFiles[0].Name)"
130-
# TODO: Output the version
130+
# Output the version
131+
$version = (Get-Content -Path "$PSScriptRoot/package.json" | ConvertFrom-Json).version
132+
Write-Host "::notice::VSIX version: $version"
133+
Add-Content -Path $outputFile -Value "vsix_version=$version"
131134
$ChangeLogPath = Join-Path -Path "$PSScriptRoot" -Child 'CHANGELOG.md'
132135
$md = ConvertFrom-Markdown $ChangeLogPath
133136
$content = Get-Content $ChangeLogPath

0 commit comments

Comments
 (0)