Skip to content

Commit

Permalink
Release workflow: Merge make-github-release and publish-to-pypi jobs
Browse files Browse the repository at this point in the history
This simplifies the process and makes it easier to follow.
  • Loading branch information
snejus committed Jun 15, 2024
1 parent e39bc5a commit 6ee810d
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/make_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,17 @@ jobs:
name: python-package-distributions
path: dist/

make-github-release:
name: Create GitHub release
publish-and-release:
name: Create GitHub release and publish distribution 📦 to PyPI
runs-on: ubuntu-latest
needs: build
env:
CHANGELOG: ${{ needs.build.outputs.changelog }}
environment:
name: pypi
url: https://pypi.org/p/beets
permissions:
id-token: write
steps:
- name: Tag the commit
id: tag_version
Expand All @@ -87,6 +92,9 @@ jobs:
name: python-package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Create a GitHub release
id: make_release
uses: ncipollo/release-action@v1
Expand All @@ -97,27 +105,10 @@ jobs:
name: Release ${{ env.NEW_TAG }}
body: ${{ env.CHANGELOG }}
artifacts: dist/*

- name: Send release toot to Fosstodon
uses: cbrgm/mastodon-github-action@v2
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 }}"

publish-to-pypi:
name: Publish distribution 📦 to PyPI
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/beets
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 6ee810d

Please sign in to comment.