Skip to content

Commit 809fb62

Browse files
committed
fix: upgrade pypi publishing
1 parent a2c3fe1 commit 809fb62

2 files changed

Lines changed: 13 additions & 21 deletions

File tree

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1+
name: Publish Python 🐍 distributions 📦 to PyPI
22

33
on:
44
push:
55
tags:
66
- 'v*'
77

8-
permissions:
9-
id-token: write
10-
118
jobs:
129
build-n-publish:
1310
if: startsWith(github.ref, 'refs/tags/')
14-
15-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
11+
name: Build and publish Python 🐍 distributions 📦 to PyPI
1612
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/samexporter
16+
permissions:
17+
id-token: write # Mandatory for trusted publishing (OIDC)
1718
steps:
1819
- uses: actions/checkout@v3
1920
- name: Set up Python
@@ -22,20 +23,11 @@ jobs:
2223
python-version: "3.x"
2324
- name: Install pypa/build
2425
run: >-
25-
python -m
26-
pip install
27-
build
28-
--user
26+
python -m pip install build==1.2.2 twine==6.1.0 --user
2927
- name: Build a binary wheel and a source tarball
3028
run: >-
31-
python -m
32-
build
33-
--wheel
34-
--outdir dist/
35-
.
29+
python -m build --sdist --wheel --outdir dist/ .
3630
- name: Publish distribution 📦 to PyPI
37-
if: startsWith(github.ref, 'refs/tags')
38-
uses: pypa/gh-action-pypi-publish@v1.8.5
31+
uses: pypa/gh-action-pypi-publish@release/v1
3932
with:
40-
password: ${{ secrets.PYPI_API_TOKEN }}
41-
skip_existing: true
33+
skip-existing: true

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
2+
requires = ["setuptools>=61.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "samexporter"
7-
version = "0.4.3"
7+
version = "0.4.4"
88
description = "Exporting Segment Anything models ONNX format"
99
authors = [
1010
{name = "Viet Anh Nguyen", email = "vietanh.dev@gmail.com"},

0 commit comments

Comments
 (0)