Skip to content

Commit e95958e

Browse files
committed
move to github release drafter
1 parent abc47a0 commit e95958e

3 files changed

Lines changed: 50 additions & 83 deletions

File tree

.github/release-drafter.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
changelog:
2+
categories:
3+
- title: '🚀 Features'
4+
labels:
5+
- 'feature'
6+
- 'enhancement'
7+
- title: '🐛 Bug Fixes'
8+
labels:
9+
- 'fix'
10+
- 'bugfix'
11+
- 'bug'
12+
- title: '📦 Dependency Updates'
13+
labels:
14+
- 'dependencies'
15+
- title: '🧰 Maintenance'
16+
labels:
17+
- 'chore'
18+
- 'maintenance'
19+
- title: '📚 Documentation'
20+
labels:
21+
- 'documentation'
22+
- 'docs'
23+
- title: 'Other Changes'
24+
labels:
25+
- '*'
Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
1-
name: Release Drafter
1+
name: Draft Release
22

33
on:
44
push:
55
branches:
66
- main
77

88
permissions:
9-
contents: read
9+
contents: write
1010

1111
jobs:
12-
update_release_draft:
13-
permissions:
14-
# write permission is required to create a github release
15-
contents: write
12+
draft_release:
1613
runs-on: ubuntu-latest
1714
steps:
18-
# Drafts your next Release notes as Pull Requests are merged into "main"
19-
- uses: release-drafter/release-drafter@v7
15+
- name: Checkout repository
16+
uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get version from manifest
21+
id: version
22+
run: |
23+
version=$(jq -r .version custom_components/victron_mqtt/manifest.json)
24+
echo "version=$version" >> $GITHUB_OUTPUT
25+
26+
- name: Create or update draft release
2027
env:
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
tag="v${{ steps.version.outputs.version }}"
31+
# Check if a draft release already exists for this tag
32+
existing=$(gh release list --json tagName,isDraft -q ".[] | select(.tagName == \"$tag\" and .isDraft) | .tagName")
33+
if [ -n "$existing" ]; then
34+
gh release edit "$tag" --draft --generate-notes
35+
else
36+
gh release create "$tag" --draft --generate-notes --title "$tag"
37+
fi

0 commit comments

Comments
 (0)