From 889351745d6bddef0a22260ef5452839c2e9c046 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 30 Jun 2021 17:32:32 +0200 Subject: [PATCH] Add release drafter (#57) --- .github/release-drafter.yml | 27 +++++++++++++++++++ .github/workflows/release-drafter.yml | 37 +++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..1acfa4e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,27 @@ +name-template: "$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" +categories: + - title: "Breaking Changes" + label: "breaking-change" + +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 0000000..6dd683c --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,37 @@ + +name: Release Drafter + +on: + push: + branches: + - master + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + id: release-draft + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Update version number in setup.py + - uses: actions/checkout@v2 + - name: Calculate version + id: version + run: | + tag="${{ steps.release-draft.outputs.tag_name }}" + echo "::set-output name=version::${tag:1}" + + - name: Set setup.py version + run: | + sed -i "s/VERSION = .*/VERSION = \"${{ steps.version.outputs.version }}\"/g" setup.py + # github actions email from here: https://github.community/t/github-actions-bot-email-address/17204 + - name: Commit changes + run: | + if ! git diff --quiet; then + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git commit -am "Bump version to ${{ steps.version.outputs.version }}" + git push + fi