Skip to content

Commit 132caef

Browse files
committed
try pypi trusted publishing
1 parent d215f6c commit 132caef

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: "PyPI Publish"
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v.*"
49

510
jobs:
611
flake8-lint:
@@ -17,6 +22,8 @@ jobs:
1722
Publish:
1823
runs-on: ubuntu-latest
1924
environment: release
25+
permissions:
26+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
2027
steps:
2128
- uses: actions/checkout@v2
2229
- uses: actions/setup-python@v4
@@ -28,11 +35,5 @@ jobs:
2835
- run: |
2936
poetry self add "poetry-dynamic-versioning[plugin]"
3037
poetry build
31-
- name: Publish PyPI
32-
run: |
33-
set -ex
34-
if curl -Isf https://pypi.org/project/sqlalchemy-nested-mutable/$(poetry version -s)/ > /dev/null; then
35-
echo "Package already exists on PyPI"
36-
else
37-
poetry publish
38-
fi
38+
- name: Publish package distributions to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ pydantic = "^1.10.8"
4646
enable = true
4747
vcs = "git"
4848
style = 'pep440'
49-
pattern = 'default-unprefixed'
5049

5150
[build-system]
5251
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]

0 commit comments

Comments
 (0)