mirror of
https://github.com/beetbox/beets.git
synced 2025-12-30 20:42:37 +01:00
98 lines
2.8 KiB
YAML
98 lines
2.8 KiB
YAML
name: Make a Beets Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version of the new release, just as a number with no prepended "v"'
|
|
required: true
|
|
|
|
jobs:
|
|
increment_version:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- 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 bump "${{ 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
|
|
with:
|
|
fetch-depth: 0
|
|
ref: master
|
|
- 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: 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: Obtain the changelog
|
|
run: echo CHANGELOG="$(python ./extra/release.py changelog)" >> $GITHUB_ENV
|
|
- name: Bump version and push tag
|
|
id: tag_version
|
|
uses: mathieudutour/github-tag-action@v6.1
|
|
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: ${{ env.CHANGELOG }}
|
|
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
|