|
@@ -78,33 +78,27 @@ runs:
|
|
|
# Git configuration for releases
|
|
# Git configuration for releases
|
|
|
git config user.name "github-actions[bot]"
|
|
git config user.name "github-actions[bot]"
|
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
|
+
|
|
|
|
|
+ TARGET_COMMIT=$(git rev-parse HEAD)
|
|
|
|
|
|
|
|
# Helper function to handle release creation
|
|
# Helper function to handle release creation
|
|
|
ensure_release() {
|
|
ensure_release() {
|
|
|
local tag_name="$1"
|
|
local tag_name="$1"
|
|
|
|
|
|
|
|
- git fetch --tags --force
|
|
|
|
|
-
|
|
|
|
|
if gh release view "$tag_name" --repo "$TARGET_REPO" >/dev/null 2>&1; then
|
|
if gh release view "$tag_name" --repo "$TARGET_REPO" >/dev/null 2>&1; then
|
|
|
echo "Release '$tag_name' already exists. Ready for upload."
|
|
echo "Release '$tag_name' already exists. Ready for upload."
|
|
|
gh release edit "$tag_name" --latest=false --repo "$TARGET_REPO" >/dev/null 2>&1 || true
|
|
gh release edit "$tag_name" --latest=false --repo "$TARGET_REPO" >/dev/null 2>&1 || true
|
|
|
return 0
|
|
return 0
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
- if ! git rev-parse "$tag_name" >/dev/null 2>&1; then
|
|
|
|
|
- echo "Tag '$tag_name' not found. Creating backdated tag and release..."
|
|
|
|
|
- GIT_COMMITTER_DATE="2015-01-01T12:00:00" git tag -a "$tag_name" -m "Build Cache Storage"
|
|
|
|
|
- if git push origin "$tag_name" --force; then
|
|
|
|
|
- gh release create "$tag_name" --title "Build Cache" --notes "Automated storage for build assets" --latest=false --repo "$TARGET_REPO" || true
|
|
|
|
|
- gh release edit "$tag_name" --latest=false --repo "$TARGET_REPO" >/dev/null 2>&1 || true
|
|
|
|
|
- else
|
|
|
|
|
- echo "Push failed, tag might have been created by a parallel job. Continuing..."
|
|
|
|
|
- fi
|
|
|
|
|
- else
|
|
|
|
|
- echo "Tag '$tag_name' already exists but release is missing. Creating release..."
|
|
|
|
|
- gh release create "$tag_name" --title "Build Cache" --notes "Automated storage for build assets" --latest=false --repo "$TARGET_REPO" || true
|
|
|
|
|
- gh release edit "$tag_name" --latest=false --repo "$TARGET_REPO" >/dev/null 2>&1 || true
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ echo "Tag '$tag_name' not found or release is missing. Creating release..."
|
|
|
|
|
+ gh release create "$tag_name" \
|
|
|
|
|
+ --target "$TARGET_COMMIT" \
|
|
|
|
|
+ --title "Build Cache" \
|
|
|
|
|
+ --notes "Automated storage for build assets" \
|
|
|
|
|
+ --latest=false \
|
|
|
|
|
+ --repo "$TARGET_REPO" || true
|
|
|
|
|
+ gh release edit "$tag_name" --latest=false --repo "$TARGET_REPO" >/dev/null 2>&1 || true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
upload_with_retry() {
|
|
upload_with_retry() {
|