Merge pull request #989 from booklore-app/develop

Merge develop into master for release
This commit is contained in:
Aditya Chandel
2025-08-25 16:19:56 -06:00
committed by GitHub
3 changed files with 43 additions and 43 deletions
+18 -6
View File
@@ -1,5 +1,17 @@
name-template: 'v$NEXT_PATCH_VERSION 🌟'
tag-template: 'v$NEXT_PATCH_VERSION'
name-template: 'v$RESOLVED_VERSION 🌟'
tag-template: 'v$RESOLVED_VERSION'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
categories:
- title: '🚀 New Features'
@@ -45,13 +57,13 @@ exclude-labels:
change-template: '- $TITLE (#$NUMBER) by @$AUTHOR'
template: |
## 🌟 What's New in v$NEXT_PATCH_VERSION
## 🌟 What's New in v$RESOLVED_VERSION
$CHANGES
### 🐳 Docker Images
- **Docker Hub:** `booklore/booklore:v$NEXT_PATCH_VERSION`
- **GitHub Container Registry:** `ghcr.io/booklore-app/booklore:v$NEXT_PATCH_VERSION`
- **Docker Hub:** `booklore/booklore:v$RESOLVED_VERSION`
- **GitHub Container Registry:** `ghcr.io/booklore-app/booklore:v$RESOLVED_VERSION`
**Full Changelog**: https://github.com/booklore-app/booklore/compare/$PREVIOUS_TAG...v$NEXT_PATCH_VERSION
**Full Changelog**: https://github.com/booklore-app/booklore/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
+24 -37
View File
@@ -51,9 +51,7 @@ jobs:
if: github.ref == 'refs/heads/master'
id: determine_bump
run: |
# Step 1: Check if the PR has a label (priority over commit message)
pr_number=$(gh pr list --state merged --base master --limit 1 --json number --jq '.[0].number')
echo "PR Number: $pr_number"
labels=$(gh pr view "$pr_number" --json labels --jq '.labels[].name' || echo "")
if echo "$labels" | grep -q 'major'; then
bump="major"
@@ -62,40 +60,40 @@ jobs:
elif echo "$labels" | grep -q 'patch'; then
bump="patch"
fi
# Step 2: If no label, fallback to commit message keywords
if [ -z "$bump" ]; then
last_commit_msg=$(git log -1 --pretty=%B)
echo "Last commit message: $last_commit_msg"
if echo "$last_commit_msg" | grep -iq '#major'; then
bump="major"
gh pr edit "$pr_number" --add-label "major" || echo "Could not add major label"
elif echo "$last_commit_msg" | grep -iq '#minor'; then
bump="minor"
gh pr edit "$pr_number" --add-label "minor" || echo "Could not add minor label"
elif echo "$last_commit_msg" | grep -iq '#patch'; then
bump="patch"
gh pr edit "$pr_number" --add-label "patch" || echo "Could not add patch label"
else
bump="patch" # Default to patch if no keyword or label
bump="patch"
gh pr edit "$pr_number" --add-label "patch" || echo "Could not add patch label"
fi
fi
echo "bump=$bump" >> $GITHUB_ENV
echo "Version bump type: $bump"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-Increment Version (Only for Master)
- name: Update Release Draft (Only for Master)
if: github.ref == 'refs/heads/master'
uses: release-drafter/release-drafter@v6
id: release_drafter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Release Version
if: github.ref == 'refs/heads/master'
id: bump_version
run: |
old_version="${{ env.latest_tag }}"
IFS='.' read -r -a parts <<< "${old_version//[!0-9.]/}"
if [ "${{ env.bump }}" = "major" ]; then
new_version="$((parts[0] + 1)).0.0"
elif [ "${{ env.bump }}" = "minor" ]; then
new_version="${parts[0]}.$((parts[1] + 1)).0"
else
new_version="${parts[0]}.${parts[1]}.$((parts[2] + 1))"
fi
new_tag="v${new_version}"
new_tag="${{ steps.release_drafter.outputs.tag_name }}"
echo "new_tag=$new_tag" >> $GITHUB_ENV
echo "New version: $new_tag"
@@ -115,14 +113,6 @@ jobs:
echo "image_tag=$image_tag" >> $GITHUB_ENV
echo "Image tag: $image_tag"
- name: Create Git Tag (Only for Master)
if: github.ref == 'refs/heads/master'
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git tag ${{ env.new_tag }}
git push origin ${{ env.new_tag }}
- name: Build and Push Docker Image (Docker Hub & GHCR)
run: |
docker buildx create --use
@@ -143,14 +133,14 @@ jobs:
--tag ghcr.io/booklore-app/booklore:latest \
--push .
- name: Update Release Draft (Only for Master)
- name: Create Git Tag (Only for Master)
if: github.ref == 'refs/heads/master'
uses: release-drafter/release-drafter@v6
with:
tag: ${{ env.new_tag }}
name: "Release ${{ env.new_tag }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
git tag ${{ env.new_tag }}
git push origin ${{ env.new_tag }}
- name: Publish Draft Release (Only for Master)
if: github.ref == 'refs/heads/master'
@@ -174,20 +164,17 @@ jobs:
fi
echo "Preparing Discord notification for release $NEW_TAG"
# fetch release info
release_json=$(gh release view "$NEW_TAG" --json name,body,url)
release_name=$(jq -r '.name' <<< "$release_json")
release_body=$(jq -r '.body' <<< "$release_json")
release_url=$(jq -r '.url' <<< "$release_json")
# trim body if too long
clean_body=$(echo "$release_body" | tr -d '\r')
max_length=1800
if [ ${#clean_body} -gt $max_length ]; then
clean_body="${clean_body:0:$((max_length-12))}… [truncated]"
fi
# build JSON payload
payload=$(jq -n \
--arg title "New Release: $release_name" \
--arg url "$release_url" \
@@ -206,4 +193,4 @@ jobs:
echo "$payload"
echo "======================="
curl -H "Content-Type: application/json" -d "$payload" "$DISCORD_WEBHOOK_URL"
curl -H "Content-Type: application/json" -d "$payload" "$DISCORD_WEBHOOK_URL"
@@ -15,6 +15,7 @@ app:
server:
forward-headers-strategy: native
port: 8080
spring:
servlet: