diff --git a/.github/workflows/make_release.yaml b/.github/workflows/make_release.yaml index 4f54cb46c..cf1b12fe2 100644 --- a/.github/workflows/make_release.yaml +++ b/.github/workflows/make_release.yaml @@ -10,10 +10,11 @@ on: env: PYTHON_VERSION: 3.8 NEW_VERSION: ${{ inputs.version }} + NEW_TAG: v${{ inputs.version }} jobs: increment-version: - name: Bump project version and commit it + name: Bump version, commit and create tag runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,13 +29,14 @@ jobs: run: poetry install --only=release - name: Bump project version - id: script run: poe bump "${{ env.NEW_VERSION }}" - uses: EndBug/add-and-commit@v9 - name: Commit the changes + id: commit_and_tag + name: Commit the changes and create tag with: message: "Increment version to ${{ env.NEW_VERSION }}" + tag: "${{ env.NEW_TAG }} --force" build: name: Get changelog and build the distribution package @@ -45,7 +47,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: master + ref: ${{ env.NEW_TAG }} - name: Install Python tools uses: BrandonLWhite/pipx-install-action@v0.1.1 @@ -103,17 +105,6 @@ jobs: env: CHANGELOG: ${{ needs.build.outputs.changelog }} 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 uses: actions/download-artifact@v4 with: @@ -123,8 +114,6 @@ jobs: - name: Create a GitHub release id: make_release uses: ncipollo/release-action@v1 - env: - NEW_TAG: ${{ steps.tag_version.outputs.new_tag }} with: tag: ${{ env.NEW_TAG }} name: Release ${{ env.NEW_TAG }} @@ -136,4 +125,4 @@ jobs: with: access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }} 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 }}" diff --git a/docs/changelog.rst b/docs/changelog.rst index e3c41b24d..bec25ece4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,11 @@ For packagers: 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) -------------------------