Files
Dariusz L faa60d4c28 Add LayerForge badge, workflows, and example workflow
Introduces a dynamic LayerForge downloads badge (LAYERFORGE.md), new GitHub Actions for badge generation and improved release versioning, and example workflow files. Updates README to use the new badge and bumps version to 1.3.0 in pyproject.toml. Adds issue templates for bug reports and documentation requests.
2025-07-01 18:02:52 +02:00

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 }}