Skip to content

Commit b98d364

Browse files
authored
updated release action (#402)
1 parent 830f6e4 commit b98d364

File tree

2 files changed

+34
-46
lines changed

2 files changed

+34
-46
lines changed

.github/workflows/release.yml

+33-45
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,43 @@
1-
name: Build and publish Python packages to PyPI
1+
name: Publish Python 🐍 distributions 📦 to PyPI
22

3-
on:
4-
workflow_dispatch:
3+
on:
54
release:
6-
types:
7-
- published
5+
types: [created]
86

9-
jobs:
10-
build:
11-
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
python-version:
15-
- "3.8"
16-
- "3.9"
17-
- "3.10"
18-
steps:
19-
- uses: actions/checkout@v3
20-
21-
- name: Set up Python
22-
uses: actions/setup-python@v4
23-
with:
24-
python-version: ${{ matrix.python-version }}
25-
cache: pip
26-
27-
- name: Install build tool
28-
run: pip install build
297

30-
- name: Build package
31-
run: python -m build
32-
33-
- name: Upload package as build artifact
34-
uses: actions/upload-artifact@v3
35-
with:
36-
name: package
37-
path: dist/
38-
39-
publish:
8+
jobs:
9+
pypi-publish:
10+
name: Upload release to PyPI
4011
runs-on: ubuntu-latest
41-
needs: build
4212
environment:
4313
name: pypi
4414
url: https://pypi.org/p/mir_eval
4515
permissions:
46-
id-token: write
16+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17+
4718
steps:
48-
- name: Collect packages to release
49-
uses: actions/[email protected]
50-
with:
51-
name: package
52-
path: dist/
53-
54-
- name: Publish packages to PyPI
55-
uses: pypa/gh-action-pypi-publish@release/v1
19+
- uses: actions/checkout@v4
20+
- name: Set up Python 3.12
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.12
24+
25+
- name: Install pypa/build
26+
run: >-
27+
python -m
28+
pip install
29+
build
30+
--user
31+
32+
- name: Build a binary wheel and a source tarball
33+
run: >-
34+
python -m
35+
build
36+
--sdist
37+
--wheel
38+
--outdir dist/
39+
.
40+
41+
- name: Publish package distributions to PyPI
42+
if: startsWith(github.ref, 'refs/tags')
43+
uses: pypa/gh-action-pypi-publish@release/v1

mir_eval/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
from . import transcription_velocity
2121
from . import key
2222

23-
__version__ = "0.8.0rc0"
23+
__version__ = "0.8.0rc1"

0 commit comments

Comments
 (0)