Skip to content

move to github release drafter #425

move to github release drafter

move to github release drafter #425

name: Draft Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
draft_release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get version from manifest
id: version
run: |
version=$(jq -r .version custom_components/victron_mqtt/manifest.json)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create or update draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="v${{ steps.version.outputs.version }}"
# Check if a draft release already exists for this tag
existing=$(gh release list --json tagName,isDraft -q ".[] | select(.tagName == \"$tag\" and .isDraft) | .tagName")
if [ -n "$existing" ]; then
gh release edit "$tag" --draft --generate-notes
else
gh release create "$tag" --draft --generate-notes --title "$tag"
fi