diff --git a/.github/release.yml b/.github/release.yml index ec577f2b..4c561783 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,4 +1,9 @@ changelog: exclude: labels: - - dependencies + - deps + # GitHub's docs use the bare login, but the `[bot]` form is what shows up + # on the commits themselves. Listing both is the only way to be sure. + authors: + - renovate + - renovate[bot] diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index ea2604fb..f794312d 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -15,24 +15,31 @@ jobs: contents: write # Create the release and its tag steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - fetch-depth: 0 - fetch-tags: true - persist-credentials: false - - - env: + - name: Create the release + shell: python + env: GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} run: | - set -eux - current="$(git describe --tags --abbrev=0 --match 'v*.*')" + import subprocess - major="$(echo "$current" | cut -d. -f1)" - minor="$(echo "$current" | cut -d. -f2)" + current = subprocess.run( + ["gh", "release", "view", "--json", "tagName", "--jq", ".tagName"], + check=True, + text=True, + capture_output=True, + ).stdout.strip() - # Major releases will be released manually. - minor=$((minor + 1)) - new_tag="${major}.${minor}" + major, minor = current.split(".")[:2] - gh release create "${new_tag}" --generate-notes --notes-start-tag "${current}" + # Major releases will be released manually. + new_tag = f"{major}.{int(minor) + 1}" + + subprocess.run( + [ + "gh", "release", "create", new_tag, + "--generate-notes", + "--notes-start-tag", current, + ], + check=True, + )