Skip to content

Commit 3f987e8

Browse files
committed
cicd: fix tags format
1 parent cf531ec commit 3f987e8

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/cd.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ jobs:
4242
fail-on-no-checks: false
4343
- run: nix build -o result
4444
- run: tar -chzvf smart-piano-engine.tar.gz -C result .
45-
- if: github.ref == 'refs/heads/main'
46-
run: |
47-
DATE=$(date -u +%Y-%m-%dT%H:%M:%S)
48-
TAG="pre-$DATE"
49-
# Cleanup old rolling releases (> 7 days or < 12 hours)
45+
- name: Cleanup Pre-Releases
46+
if: github.ref == 'refs/heads/main'
47+
run: | # Cleanup old rolling releases (> 7 days or < 12 hours)
5048
gh release list --limit 100 | grep "pre-" | while read -r line; do
5149
OLD_TAG=$(echo "$line" | awk '{print $1}')
5250
OLD_DATE=${OLD_TAG#pre-}
@@ -56,8 +54,13 @@ jobs:
5654
gh release delete "$OLD_TAG" --yes --cleanup-tag
5755
fi
5856
done
57+
- name: Publish Timestamped Pre-Release
58+
if: github.ref == 'refs/heads/main'
59+
run: |
60+
TAG="pre-$(date -u +%Y-%m-%dT%H-%M-%S)"
5961
gh release create "$TAG" smart-piano-engine.tar.gz --title "$DATE" --notes "Automated pre-release for $DATE" --prerelease
60-
- if: startsWith(github.ref, 'refs/tags/v')
62+
- name: Publish Semantically Versionned Release
63+
if: startsWith(github.ref, 'refs/tags/v')
6164
run: |
6265
TAG=${GITHUB_REF#refs/tags/}
6366
gh release create "$TAG" smart-piano-engine.tar.gz --title "SmartPiano $TAG" --notes "Release $TAG"

0 commit comments

Comments
 (0)