Skip to content

Commit f2fabdf

Browse files
committed
Fix version path and add release cleanup
- Update version extraction to use skills/fastskill/skill-project.toml - Add step to delete old/broken releases before creating new one - Ensure clean release history with correct version tags
1 parent e679b1b commit f2fabdf

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/publish-skill.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Get version
5454
id: version
5555
run: |
56-
VERSION=$(grep '^version = ' skills/skill-project.toml | sed 's/version = "\([^"]*\)"/\1/')
56+
VERSION=$(grep '^version = ' skills/fastskill/skill-project.toml | sed 's/version = "\([^"]*\)"/\1/')
5757
echo "version=$VERSION" >> $GITHUB_OUTPUT
5858
5959
- name: Package skill using FastSkill
@@ -66,6 +66,19 @@ jobs:
6666
--force \
6767
--output ./artifacts
6868
69+
- name: Delete old releases
70+
if: steps.detect.outputs.changed == 'true' || steps.detect.outputs.force == 'true'
71+
run: |
72+
# Delete any releases with incorrect or old tags
73+
for tag in $(gh release list --json tagName --jq '.[].tagName'); do
74+
if [ "$tag" = "v" ] || [ "$tag" != "v${{ steps.version.outputs.version }}" ]; then
75+
echo "Deleting release $tag"
76+
gh release delete "$tag" --yes --cleanup-tag || true
77+
fi
78+
done
79+
env:
80+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
81+
6982
- name: Generate GitHub App Token
7083
id: app-token
7184
if: steps.detect.outputs.changed == 'true' || steps.detect.outputs.force == 'true'

0 commit comments

Comments
 (0)