Release: create tag right after commit version update

This commit is contained in:
Šarūnas Nejus 2024-12-06 18:24:59 +00:00
parent ed3a53f2fe
commit 71eb1bca68
No known key found for this signature in database
GPG key ID: DD28F6704DBE3435
2 changed files with 12 additions and 18 deletions

View file

@ -10,10 +10,11 @@ on:
env: env:
PYTHON_VERSION: 3.8 PYTHON_VERSION: 3.8
NEW_VERSION: ${{ inputs.version }} NEW_VERSION: ${{ inputs.version }}
NEW_TAG: v${{ inputs.version }}
jobs: jobs:
increment-version: increment-version:
name: Bump project version and commit it name: Bump version, commit and create tag
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -28,13 +29,14 @@ jobs:
run: poetry install --only=release run: poetry install --only=release
- name: Bump project version - name: Bump project version
id: script
run: poe bump "${{ env.NEW_VERSION }}" run: poe bump "${{ env.NEW_VERSION }}"
- uses: EndBug/add-and-commit@v9 - uses: EndBug/add-and-commit@v9
name: Commit the changes id: commit_and_tag
name: Commit the changes and create tag
with: with:
message: "Increment version to ${{ env.NEW_VERSION }}" message: "Increment version to ${{ env.NEW_VERSION }}"
tag: "${{ env.NEW_TAG }} --force"
build: build:
name: Get changelog and build the distribution package name: Get changelog and build the distribution package
@ -45,7 +47,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
ref: master ref: ${{ env.NEW_TAG }}
- name: Install Python tools - name: Install Python tools
uses: BrandonLWhite/pipx-install-action@v0.1.1 uses: BrandonLWhite/pipx-install-action@v0.1.1
@ -103,17 +105,6 @@ jobs:
env: env:
CHANGELOG: ${{ needs.build.outputs.changelog }} CHANGELOG: ${{ needs.build.outputs.changelog }}
steps: steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Tag the commit
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.NEW_VERSION }}
- name: Download all the dists - name: Download all the dists
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
@ -123,8 +114,6 @@ jobs:
- name: Create a GitHub release - name: Create a GitHub release
id: make_release id: make_release
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
env:
NEW_TAG: ${{ steps.tag_version.outputs.new_tag }}
with: with:
tag: ${{ env.NEW_TAG }} tag: ${{ env.NEW_TAG }}
name: Release ${{ env.NEW_TAG }} name: Release ${{ env.NEW_TAG }}
@ -136,4 +125,4 @@ jobs:
with: with:
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
url: ${{ secrets.MASTODON_URL }} url: ${{ secrets.MASTODON_URL }}
message: "Version ${{ steps.tag_version.outputs.new_tag }} of beets has been released! Check out all of the new changes at ${{ steps.create_release.outputs.html_url }}" message: "Version ${{ env.NEW_TAG }} of beets has been released! Check out all of the new changes at ${{ steps.make_release.outputs.html_url }}"

View file

@ -21,6 +21,11 @@ For packagers:
Other changes: Other changes:
* Release workflow: fix the issue where the new release tag is created for the
wrong (outdated) commit. Now the tag is created in the same workflow step
right after committing the version update.
:bug:`5539`
2.2.0 (December 02, 2024) 2.2.0 (December 02, 2024)
------------------------- -------------------------