mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-22 05:02:11 -03:00
57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Auto Release with Version Check
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract base version from pyproject.toml
|
|
id: version
|
|
run: |
|
|
base=$(grep '^version *= *"' pyproject.toml | sed -E 's/version *= *"([^"]+)"/\1/')
|
|
echo "base_version=$base" >> $GITHUB_OUTPUT
|
|
|
|
- name: Check if tag for this version already exists
|
|
run: |
|
|
TAG="v${{ steps.version.outputs.base_version }}"
|
|
git fetch --tags
|
|
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
|
echo "Tag $TAG already exists. Skipping release."
|
|
exit 0
|
|
fi
|
|
|
|
- name: Set version tag
|
|
id: unique_tag
|
|
run: |
|
|
echo "final_tag=v${{ steps.version.outputs.base_version }}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Get latest commit message
|
|
id: last_commit
|
|
run: |
|
|
msg=$(git log -1 --pretty=%B)
|
|
msg=${msg//$'\n'/\\n}
|
|
echo "commit_msg=$msg" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
tag_name: ${{ steps.unique_tag.outputs.final_tag }}
|
|
name: Release ${{ steps.unique_tag.outputs.final_tag }}
|
|
body: |
|
|
📦 Release based on pyproject.toml version `${{ steps.version.outputs.base_version }}`
|
|
|
|
📝 Last commit message:
|
|
```
|
|
${{ steps.last_commit.outputs.commit_msg }}
|
|
```
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|