Skip to content

Commit dc5c47f

Browse files
authored
Setup workflow to publish on PyPI.org
1 parent 5a632a4 commit dc5c47f

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

.github/workflows/black.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ jobs:
77
timeout-minutes: 10
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
1111
- uses: psf/black@stable

.github/workflows/publish.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
1-
name: Build and upload Python Package to pypi.autoactuary.com
1+
name: Build and publish release
22

3-
on:
4-
release:
5-
types: [created]
3+
on: push
64

75
jobs:
8-
deploy:
9-
timeout-minutes: 20
10-
6+
pypi-publish:
7+
name: Upload release to PyPI
8+
if: startsWith(github.ref, 'refs/tags/')
119
runs-on: ubuntu-latest
12-
10+
environment:
11+
name: pypi
12+
url: https://pypi.org/p/mkdocstrings-vba
13+
permissions:
14+
id-token: write
1315
steps:
14-
- uses: actions/checkout@v3
15-
- name: Set up Python
16-
uses: actions/setup-python@v4
17-
with:
18-
python-version: '3.x'
19-
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install setuptools wheel twine
23-
- name: Build and publish
24-
env:
25-
TWINE_USERNAME: 'aa'
26-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
27-
TWINE_REPOSITORY_URL: 'https://pypi.autoactuary.com'
28-
run: |
29-
python setup.py sdist bdist_wheel
30-
twine upload dist/*
16+
- uses: actions/checkout@v4
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install build
25+
- name: Build distributions
26+
run: python -m build
27+
- name: Publish package distributions to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)