Make a Beets Release #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Make a Beets Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version of the new release' | |
required: true | |
jobs: | |
increment_version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install pandoc | |
run: sudo apt update && sudo apt install pandoc -y | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Run version script | |
id: script | |
run: | | |
python extra/release.py "${{ inputs.version }}" | |
- uses: EndBug/add-and-commit@v9 | |
name: Commit the changes | |
with: | |
message: 'Increment version numbers to ${{ inputs.version }}' | |
build: | |
runs-on: ubuntu-latest | |
needs: increment_version | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- run: pip install build wheel sphinx | |
- name: Build a binary wheel and a source tarball | |
env: | |
TZ: UTC | |
run: python3 -m build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
make_github_release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ inputs.version }} | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: Release ${{ steps.tag_version.outputs.new_tag }} | |
body: "Check [here](https://beets.readthedocs.io/en/stable/changelog.html) for the latest changes." | |
artifacts: dist/* | |
publish_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@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |