Skip to content

Commit

Permalink
updated release action (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee authored Feb 6, 2025
1 parent 830f6e4 commit b98d364
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 46 deletions.
78 changes: 33 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,43 @@
name: Build and publish Python packages to PyPI
name: Publish Python 🐍 distributions 📦 to PyPI

on:
workflow_dispatch:
on:
release:
types:
- published
types: [created]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install build tool
run: pip install build

- name: Build package
run: python -m build

- name: Upload package as build artifact
uses: actions/upload-artifact@v3
with:
name: package
path: dist/

publish:
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/mir_eval
permissions:
id-token: write
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Collect packages to release
uses: actions/[email protected]
with:
name: package
path: dist/

- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion mir_eval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
from . import transcription_velocity
from . import key

__version__ = "0.8.0rc0"
__version__ = "0.8.0rc1"

0 comments on commit b98d364

Please sign in to comment.