Skip to content

Commit 02f016c

Browse files
authored
Update Publish workflow to use Tag (RooCodeInc#4132)
1 parent e9c7377 commit 02f016c

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

.github/workflows/publish.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
options:
1212
- pre-release
1313
- release
14+
tag:
15+
description: "Enter existing tag to publish (e.g., v3.1.2)"
16+
required: true
17+
type: string
1418

1519
permissions:
1620
contents: write
@@ -30,6 +34,8 @@ jobs:
3034

3135
steps:
3236
- uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.event.inputs.tag }}
3339

3440
- name: Setup Node.js
3541
uses: actions/setup-node@v4
@@ -69,14 +75,20 @@ jobs:
6975
VERSION=$(node -p "require('./package.json').version")
7076
echo "version=$VERSION" >> $GITHUB_OUTPUT
7177
72-
- name: Create Git Tag
73-
id: create_tag
78+
- name: Validate Tag
79+
id: validate_tag
7480
run: |
75-
VERSION=v${{ steps.get_version.outputs.version }}
76-
echo "tag=$VERSION" >> $GITHUB_OUTPUT
77-
echo "Tagging with $VERSION"
78-
git tag "$VERSION"
79-
git push origin "$VERSION"
81+
TAG="${{ github.event.inputs.tag }}"
82+
echo "tag=$TAG" >> $GITHUB_OUTPUT
83+
echo "Using existing tag: $TAG"
84+
85+
# Verify the tag exists
86+
if ! git rev-parse "$TAG" >/dev/null 2>&1; then
87+
echo "Error: Tag '$TAG' does not exist in the repository"
88+
exit 1
89+
fi
90+
91+
echo "Tag '$TAG' validated successfully"
8092
8193
- name: Package and Publish Extension
8294
env:
@@ -106,7 +118,7 @@ jobs:
106118
- name: Create GitHub Release
107119
uses: softprops/action-gh-release@v1
108120
with:
109-
tag_name: ${{ steps.create_tag.outputs.tag }}
121+
tag_name: ${{ steps.validate_tag.outputs.tag }}
110122
files: "*.vsix"
111123
# body: ${{ steps.changelog.outputs.content }}
112124
generate_release_notes: true

0 commit comments

Comments
 (0)