Skip to content

Commit bc0f231

Browse files
committed
🔧 chore: update release workflow to support version tags
1 parent f271cf1 commit bc0f231

1 file changed

Lines changed: 9 additions & 32 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*.*.*"
6+
- "*.*.*"
77

88
permissions:
99
contents: write
@@ -16,35 +16,24 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v6
1818

19-
- name: Setup Node.js
20-
uses: actions/setup-node@v6
21-
with:
22-
node-version: "lts/*"
23-
cache: "npm"
24-
25-
- name: Install dependencies
26-
run: npm ci
27-
28-
- name: Run tests
29-
uses: coactions/setup-xvfb@v1
30-
with:
31-
run: npm test
32-
33-
- name: Package extension
19+
- name: Create release archive
3420
run: |
35-
npx @vscode/vsce package
21+
mkdir -p release
22+
rsync -av --exclude='.git' --exclude='.github' --exclude='release' . release/MageForge
23+
cd release
24+
tar -czf mageforge-${{ steps.get_version.outputs.VERSION }}.tar.gz MageForge/
3625
3726
- name: Get version from tag
3827
id: get_version
3928
run: |
40-
VERSION=${GITHUB_REF#refs/tags/v}
29+
VERSION=${GITHUB_REF#refs/tags/}
4130
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
4231
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
4332
4433
- name: Extract changelog for version
4534
id: changelog
4635
run: |
47-
VERSION=${GITHUB_REF#refs/tags/v}
36+
VERSION=${GITHUB_REF#refs/tags/}
4837
# Extract changelog section for this version
4938
sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d' > release_notes.md
5039
if [ ! -s release_notes.md ]; then
@@ -56,22 +45,10 @@ jobs:
5645
- name: Create GitHub Release
5746
uses: ncipollo/release-action@v1
5847
with:
59-
artifacts: "*.vsix"
48+
artifacts: "release/*.tar.gz"
6049
bodyFile: "release_notes.md"
6150
draft: false
6251
prerelease: false
6352
name: "Release ${{ steps.get_version.outputs.TAG }}"
6453
tag: ${{ steps.get_version.outputs.TAG }}
6554
token: ${{ secrets.GITHUB_TOKEN }}
66-
67-
# Publishing to marketplaces requires secrets to be configured
68-
# VSCE_PAT and OVSX_PAT need to be added as repository secrets
69-
# Uncomment and configure these steps when ready to publish
70-
71-
# - name: Publish to VS Code Marketplace
72-
# run: npx @vscode/vsce publish --pat ${{ secrets.VSCE_PAT }}
73-
# if: secrets.VSCE_PAT != null
74-
75-
# - name: Publish to Open VSX Registry
76-
# run: npx ovsx publish *.vsix --pat ${{ secrets.OVSX_PAT }}
77-
# if: secrets.OVSX_PAT != null

0 commit comments

Comments
 (0)