11b55fc638
* chore: improve release script for branch protection - Create PR for version bump instead of direct push to main - Wait for CI checks before merging - Auto-merge PR and create signed tag - Better error handling and gh CLI validation - Works with GitHub branch protection rules * chore(ci): create draft releases for manual release notes Release notes should be descriptive, not auto-generated commit lists. The workflow now creates a DRAFT release with a template. User edits the release notes following the style guide, then publishes.
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get version info
|
|
id: version
|
|
run: |
|
|
CURRENT_TAG=${GITHUB_REF#refs/tags/}
|
|
VERSION=${CURRENT_TAG#v}
|
|
echo "tag=$CURRENT_TAG" >> $GITHUB_OUTPUT
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
|
|
# Get previous tag
|
|
PREV_TAG=$(git tag --sort=-v:refname | grep -A1 "^${CURRENT_TAG}$" | tail -1)
|
|
if [ "$PREV_TAG" = "$CURRENT_TAG" ]; then
|
|
PREV_TAG=""
|
|
fi
|
|
echo "previous_tag=$PREV_TAG" >> $GITHUB_OUTPUT
|
|
|
|
- name: Generate release template
|
|
run: |
|
|
cat > release_notes.md << 'EOF'
|
|
## What's New
|
|
|
|
<!--
|
|
Write 1-2 sentences describing the main changes in this release.
|
|
Example: This release introduces a medication refill tracking feature and improves the mobile user experience.
|
|
-->
|
|
|
|
### New Features
|
|
|
|
<!-- List new features with **bold** names and descriptions -->
|
|
- **Feature Name**: Description of the feature
|
|
|
|
### Improvements
|
|
|
|
<!-- List improvements and fixes -->
|
|
- **Improvement**: Description
|
|
|
|
### Where to Find It
|
|
|
|
<!-- Tell users where they can access new features -->
|
|
|
|
---
|
|
|
|
## Docker Images
|
|
|
|
```bash
|
|
docker pull ghcr.io/danielvolz/medassist-ng-backend:${{ steps.version.outputs.version }}
|
|
docker pull ghcr.io/danielvolz/medassist-ng-frontend:${{ steps.version.outputs.version }}
|
|
```
|
|
|
|
**Full Changelog**: https://github.com/DanielVolz/medassist-ng/compare/${{ steps.version.outputs.previous_tag }}...${{ steps.version.outputs.tag }}
|
|
EOF
|
|
|
|
- name: Create Draft Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
body_path: release_notes.md
|
|
draft: true
|
|
generate_release_notes: false
|
|
name: "Release ${{ steps.version.outputs.tag }}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|