Skip to content

Commit 522fbda

Browse files
committed
Update distribution method
1 parent 0c177df commit 522fbda

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,29 @@ jobs:
8686
path: ./build/html
8787

8888
deploy:
89+
name: Build and Release
8990
runs-on: ubuntu-latest
9091
if: contains(github.ref, 'refs/tags/')
91-
needs: maya
92+
93+
environment:
94+
name: pypi
95+
url: https://pypi.org/p/cmdx
96+
permissions:
97+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
98+
9299
steps:
93-
- uses: actions/checkout@v2
94-
- name: Set up Python
95-
uses: actions/setup-python@v2
96-
with:
97-
python-version: '3.x'
98-
- name: Install dependencies
99-
run: |
100-
python -m pip install --upgrade pip
101-
pip install setuptools wheel twine
102-
- name: Build and publish
103-
env:
104-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
105-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
106-
run: |
107-
python setup.py sdist bdist_wheel
108-
twine upload dist/*
100+
- name: Checkout repository
101+
uses: actions/checkout@v4
102+
- name: Set up Python
103+
uses: actions/setup-python@v4
104+
with:
105+
python-version: "3.7.x"
106+
- name: Install build dependency
107+
run: python3 -m pip install --upgrade build
108+
- name: Build a binary wheel and a source tarball
109+
run: python3 -m build
110+
- name: Release to PyPi
111+
uses: pypa/gh-action-pypi-publish@release/v1
109112

110113
docs:
111114
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)