From b7daaf19804e56bdfc2ec73b292716f966015a6f Mon Sep 17 00:00:00 2001 From: Liuyang Wan Date: Sun, 19 Feb 2023 17:51:21 +0800 Subject: [PATCH] Add release drafter and pubilsh on tag creation (#2428) --- .github/release-drafter.yml | 45 ++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 8 ++++++ .github/workflows/pypi-release.yml | 7 +++-- 3 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..a8a2fb9f --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,45 @@ +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: 'Features' + labels: + - 'feature' + - 'enhancement' + - title: 'Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: 'Maintenance' + label: 'chore' +autolabeler: + - label: 'chore' + files: + - '*.md' + branch: + - '/docs{0,1}\/.+/' + - label: 'bug' + branch: + - '/fix\/.+/' + title: + - '/fix/i' + - label: 'enhancement' + branch: + - '/feature\/.+/' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - 'major' + minor: + labels: + - 'minor' + patch: + labels: + - 'patch' + default: minor +template: | + ## Changes + + $CHANGES diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20137ef8..2adb26a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,4 +24,12 @@ jobs: run: tox - name: Upload coverage to Codecov uses: codecov/codecov-action@v2.1.0 + draft: + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/master' + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 11d4f717..fd020893 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -1,14 +1,15 @@ name: Publish to PyPI on: - release: - types: [created] + push: + tags: + - "*" jobs: publish: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install dependencies