diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 000000000..07843c8c9 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,31 @@ +name-template: "$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" +categories: + - title: "Breaking Changes" + label: "breaking-change" + - title: "Dependencies" + collapse-after: 1 + labels: + - "dependencies" + +version-resolver: + major: + labels: + - "major" + - "breaking-change" + minor: + labels: + - "minor" + - "new-feature" + patch: + labels: + - "bugfix" + - "dependencies" + - "documentation" + - "enhancement" + default: patch + +template: | + ## What's Changed + + $CHANGES diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 000000000..878a8958b --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,34 @@ +name: Release Drafter + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: read + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v6 + id: drafter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@v4 + + - name: Set library.json version + run: | + sed -i "s/\"version\": .*/\"version\": \"${{ steps.drafter.outputs.resolved_version }}\"/g" library.json + + - name: Commit changes + run: | + if ! git diff --quiet; then + git config --global user.name "esphomebot" + git config --global user.email "68923041+esphomebot@users.noreply.github.com" + git commit -am "Bump version to ${{ steps.drafter.outputs.resolved_version }}" + git push + fi