Skip to content

Commit 735b578

Browse files
committed
Try to fix tmbundle release workflow
1 parent a5edf4a commit 735b578

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/tmbundle.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,30 @@ jobs:
2020
uses: actions/setup-node@v5
2121
with:
2222
node-version: '>=20.x.x'
23-
23+
2424
- name: Install vsce
2525
run: npm install -g @vscode/vsce
2626

2727
- name: Package .vsix
2828
run: cd plush.tmbundle && vsce package
2929

30-
- name: Extract version
31-
run: echo "TAG=$(jq -r '.version' plush.tmbundle/package.json)" >> $GITHUB_ENV
30+
- name: Extract version and set tag
31+
run: |
32+
VERSION=$(jq -r '.version' plush.tmbundle/package.json)
33+
echo "TAG=vsix-$VERSION" >> $GITHUB_ENV
34+
35+
- name: Delete Existing Release (if any)
36+
run: |
37+
if gh release view ${{ env.TAG }} --repo ${{ github.repository }} > /dev/null 2>&1; then
38+
echo "Release with tag ${{ env.TAG }} exists, deleting it..."
39+
gh release delete ${{ env.TAG }} --repo ${{ github.repository }} --yes
40+
else
41+
echo "No release with tag ${{ env.TAG }} exists, proceeding..."
42+
fi
43+
env:
44+
GH_TOKEN: ${{ github.token }}
3245

3346
- name: Create Release
34-
run: gh release create $TAG 'plush.tmbundle/*.vsix' --generate-notes
47+
run: gh release create ${{ env.TAG }} 'plush.tmbundle/*.vsix' --generate-notes
3548
env:
36-
GH_TOKEN: ${{ github.token }}
49+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)