|
1 |
| -name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI |
| 1 | +name: Publish Python 🐍 Distribution 📦 to PyPI and TestPyPI |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
|
9 | 9 |
|
10 | 10 | jobs:
|
11 | 11 | build:
|
12 |
| - name: Build distribution 📦 |
| 12 | + name: Build Distribution 📦 |
13 | 13 | runs-on: ubuntu-latest
|
14 | 14 |
|
15 | 15 | steps:
|
16 |
| - - uses: actions/checkout@v4 |
17 |
| - - name: Set up Python |
| 16 | + - name: Checkout Code |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Set Up Python |
18 | 20 | uses: actions/setup-python@v4
|
19 | 21 | with:
|
20 | 22 | python-version: "3.*"
|
21 | 23 |
|
22 |
| - - name: Install pypa/build |
| 24 | + - name: Install Build Dependencies |
23 | 25 | run: pip install ".[build]"
|
24 | 26 |
|
25 |
| - - name: Build a binary wheel and a source tarball |
| 27 | + - name: Build Distribution Packages |
26 | 28 | run: python3 -m build
|
27 | 29 |
|
28 |
| - - name: Store the distribution packages |
29 |
| - uses: actions/upload-artifact@v3 |
| 30 | + - name: Upload Distribution Packages |
| 31 | + uses: actions/upload-artifact@v4 |
30 | 32 | with:
|
31 | 33 | name: python-package-distributions
|
32 | 34 | path: dist/
|
33 | 35 |
|
34 | 36 | publish-to-pypi:
|
35 |
| - name: >- |
36 |
| - Publish Python 🐍 distribution 📦 to PyPI |
37 |
| -
|
38 |
| - # only publish to PyPI on tag pushes |
39 |
| - if: startsWith(github.ref, 'refs/tags/') |
40 |
| - needs: |
41 |
| - - build |
| 37 | + name: Publish Distribution 📦 to PyPI |
| 38 | + if: startsWith(github.ref, 'refs/tags/') # Only publish on tag pushes |
| 39 | + needs: build |
42 | 40 | runs-on: ubuntu-latest
|
43 | 41 |
|
44 |
| - environment: |
45 |
| - name: pypi |
46 |
| - url: https://pypi.org/p/brazilcep |
47 |
| - |
48 | 42 | permissions:
|
49 | 43 | id-token: write
|
50 | 44 |
|
51 | 45 | steps:
|
52 |
| - - name: Download all the dists |
53 |
| - uses: actions/download-artifact@v3 |
| 46 | + - name: Download Distribution Packages |
| 47 | + uses: actions/download-artifact@v4 |
54 | 48 | with:
|
55 | 49 | name: python-package-distributions
|
56 | 50 | path: dist/
|
57 | 51 |
|
58 |
| - - name: Publish distribution 📦 to PyPI |
| 52 | + - name: Publish to PyPI |
59 | 53 | uses: pypa/gh-action-pypi-publish@release/v1
|
0 commit comments