Skip to content

Commit

Permalink
Add release-drafter
Browse files Browse the repository at this point in the history
  • Loading branch information
woopstar committed Sep 29, 2024
1 parent 5827f1a commit 6158ff3
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- #$NUMBER $TITLE @$AUTHOR'
sort-direction: ascending
exclude-labels:
- 'skip-changelog'
categories:
- title: '⚒️ Breaking Changes'
labels:
- breaking-change

- title: '🚀 Features'
labels:
- 'feature request'
- 'enhancement'

- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'

- title: '🧬 Changes to Charge Owner informations'
labels:
- chargeowner
- chargeowners

- title: '🧬 New Charge Owner(s) added'
labels:
- 'new chargeowner'

- title: '🧰 Maintenance'
label: 'chore'

- title: '📦 Dependencies'
labels:
- 'dependencies'

version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
autolabeler:
- label: 'bug'
branch:
- '/fix\/.+/'
- label: 'feature request'
branch:
- '/feature\/.+/'
25 changes: 25 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release Drafter

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
name: Update release draft
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create Release
uses: release-drafter/release-drafter@v6
with:
disable-releaser: github.ref != 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
workflow_dispatch:
release:
types: [published]

env:
COMPONENT_DIR: smoothing_analytics_sensors

jobs:
release_zip_file:
name: Prepare release asset
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Update manifest.json version to ${{ github.event.release.tag_name }}
run: |
python3 ${{ github.workspace }}/.github/scripts/update_hacs_manifest.py --version ${{ github.event.release.tag_name }} --path /custom_components/smoothing_analytics_sensors/
- name: Commit manifest update
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add ./custom_components/smoothing_analytics_sensors/manifest.json
git commit -m "Updated manifest.json"
git push origin HEAD:master
- name: Create zip
run: |
cd custom_components/smoothing_analytics_sensors
zip smoothing_analytics_sensors.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./custom_components/smoothing_analytics_sensors/smoothing_analytics_sensors.zip
asset_name: smoothing_analytics_sensors.zip
tag: ${{ github.ref }}
overwrite: true

0 comments on commit 6158ff3

Please sign in to comment.