diff --git a/.github/workflows/make_release.yaml b/.github/workflows/make_release.yaml new file mode 100644 index 000000000..96350643f --- /dev/null +++ b/.github/workflows/make_release.yaml @@ -0,0 +1,74 @@ +name: Make a Beets Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version of the new release' + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + 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@v2 + - 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: ${{ steps.tag_version.outputs.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 + + \ No newline at end of file