mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
Add GitHub Actions workflow for automated releases
Introduces a release workflow that triggers on pushes to main. The workflow extracts the version from pyproject.toml, ensures unique version tags, and creates a GitHub release using softprops/action-gh-release.
This commit is contained in:
48
.github/workflows/release.yml
vendored
Normal file
48
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Auto Release with Version Patch
|
||||
|
||||
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: Determine unique version tag
|
||||
id: unique_tag
|
||||
run: |
|
||||
BASE="v${{ steps.version.outputs.base_version }}"
|
||||
TAG=$BASE
|
||||
COUNT=0
|
||||
|
||||
# Fetch remote tags
|
||||
git fetch --tags
|
||||
|
||||
while git rev-parse "$TAG" >/dev/null 2>&1; do
|
||||
COUNT=$((COUNT + 1))
|
||||
TAG="$BASE.$COUNT"
|
||||
done
|
||||
|
||||
echo "final_tag=$TAG" >> $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 }}`
|
||||
🔁 Auto-postfix to avoid duplicate tag: `${{ steps.unique_tag.outputs.final_tag }}`
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user