Fix CI release upload: support versioned releases on tag pushes
- Upload step now runs on both main pushes and v* tag pushes - Tag pushes create a versioned release (e.g., "Voice to Notes v0.2.0") - Main pushes update the "latest" prerelease as before - Windows: filter for *-setup.exe to avoid uploading non-installer binaries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -65,13 +65,25 @@ jobs:
|
||||
|
||||
# ── Release ──
|
||||
- name: Upload to release
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||
env:
|
||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||
run: |
|
||||
TAG="latest"
|
||||
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
|
||||
# Use version tag for tag pushes, "latest" for main
|
||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
||||
TAG="${GITHUB_REF#refs/tags/}"
|
||||
RELEASE_NAME="Voice to Notes ${TAG}"
|
||||
PRERELEASE=false
|
||||
else
|
||||
TAG="latest"
|
||||
RELEASE_NAME="Voice to Notes (Latest Build)"
|
||||
PRERELEASE=true
|
||||
fi
|
||||
|
||||
echo "Release tag: ${TAG}"
|
||||
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
||||
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
|
||||
|
||||
@@ -79,7 +91,7 @@ jobs:
|
||||
RELEASE_ID=$(curl -s -X POST \
|
||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"Voice to Notes (Latest Build)\", \"body\": \"Latest automated build from main branch.\", \"draft\": false, \"prerelease\": true}" \
|
||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": ${PRERELEASE}}" \
|
||||
"${REPO_API}/releases" | jq -r '.id')
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user