mirror of
https://github.com/booklore-app/booklore.git
synced 2026-02-18 00:17:53 +01:00
Merge branch 'master' into develop
This commit is contained in:
34
.github/release-drafter.yml
vendored
Normal file
34
.github/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name-template: 'v$NEXT_PATCH_VERSION 🌟'
|
||||
tag-template: 'v$NEXT_PATCH_VERSION'
|
||||
|
||||
categories:
|
||||
- title: '🚀 Features'
|
||||
labels:
|
||||
- 'feature'
|
||||
- 'enhancement'
|
||||
- title: '🐛 Bug Fixes'
|
||||
labels:
|
||||
- 'bug'
|
||||
- 'fix'
|
||||
- title: '🛠️ Refactoring'
|
||||
labels:
|
||||
- 'refactor'
|
||||
- 'cleanup'
|
||||
- title: '📖 Documentation'
|
||||
labels:
|
||||
- 'docs'
|
||||
- 'documentation'
|
||||
- title: '⚙️ CI/CD'
|
||||
labels:
|
||||
- 'ci'
|
||||
- 'cd'
|
||||
- 'workflow'
|
||||
|
||||
change-template: '- $TITLE (#$NUMBER) by @$AUTHOR'
|
||||
|
||||
template: |
|
||||
## 🌟 Changes in this release:
|
||||
$CHANGES
|
||||
|
||||
## 📣 Contributors:
|
||||
$CONTRIBUTORS 🙌
|
||||
46
.github/workflows/docker-build-publish.yml
vendored
46
.github/workflows/docker-build-publish.yml
vendored
@@ -2,6 +2,9 @@ name: Build, Tag, Push, and Release to GitHub Container Registry
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
@@ -10,6 +13,7 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
@@ -34,13 +38,36 @@ jobs:
|
||||
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
|
||||
echo "Latest master tag: $latest_tag"
|
||||
|
||||
- name: Determine Version Bump (Only for Master)
|
||||
if: github.ref == 'refs/heads/master'
|
||||
id: determine_bump
|
||||
run: |
|
||||
labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name' || echo "")
|
||||
if echo "$labels" | grep -q 'breaking-change'; then
|
||||
bump="major"
|
||||
elif echo "$labels" | grep -q 'feature\|enhancement'; then
|
||||
bump="minor"
|
||||
else
|
||||
bump="patch"
|
||||
fi
|
||||
echo "bump=$bump" >> $GITHUB_ENV
|
||||
echo "Version bump type: $bump"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Auto-Increment Version (Only for Master)
|
||||
if: github.ref == 'refs/heads/master'
|
||||
id: bump_version
|
||||
run: |
|
||||
old_version=${{ env.latest_tag }}
|
||||
old_version="${{ env.latest_tag }}"
|
||||
IFS='.' read -r -a parts <<< "${old_version//[!0-9.]/}"
|
||||
new_version="${parts[0]}.${parts[1]}.$((parts[2] + 1))"
|
||||
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}"
|
||||
echo "new_tag=$new_tag" >> $GITHUB_ENV
|
||||
echo "New version: $new_tag"
|
||||
@@ -85,14 +112,21 @@ jobs:
|
||||
--tag ghcr.io/${{ github.actor }}/booklore-app:latest \
|
||||
--push .
|
||||
|
||||
- name: Create GitHub Release (Only for Master)
|
||||
- name: Update Release Draft (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 }}
|
||||
|
||||
- name: Publish Draft Release (Only for Master)
|
||||
if: github.ref == 'refs/heads/master'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release create ${{ env.new_tag }} \
|
||||
--title "Release ${{ env.new_tag }}" \
|
||||
--notes "Automated release for ${{ env.new_tag }}"
|
||||
gh release edit ${{ env.new_tag }} --draft=false
|
||||
|
||||
- name: Delete Feature/Bug Branches (Only for Master and Develop)
|
||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
|
||||
|
||||
Reference in New Issue
Block a user