|
| 1 | +name: Publish |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | +jobs: |
| 5 | + build: |
| 6 | + name: Build distribution |
| 7 | + runs-on: ubuntu-latest |
| 8 | + |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v5 |
| 11 | + with: |
| 12 | + persist-credentials: false |
| 13 | + - name: Set up Python |
| 14 | + uses: actions/setup-python@v6 |
| 15 | + with: |
| 16 | + python-version: "3.x" |
| 17 | + - name: Install pypa/build |
| 18 | + run: >- |
| 19 | + python3 -m |
| 20 | + pip install |
| 21 | + build |
| 22 | + --user |
| 23 | + - name: Build a binary wheel and a source tarball |
| 24 | + run: python3 -m build |
| 25 | + - name: Store the distribution packages |
| 26 | + uses: actions/upload-artifact@v4 |
| 27 | + with: |
| 28 | + name: python-package-distributions |
| 29 | + path: dist/ |
| 30 | + |
| 31 | + publish-to-pypi: |
| 32 | + name: Publish Python distribution to PyPI |
| 33 | + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes |
| 34 | + needs: |
| 35 | + - build |
| 36 | + runs-on: ubuntu-latest |
| 37 | + |
| 38 | + environment: |
| 39 | + name: pypi |
| 40 | + url: https://pypi.org/p/dnspython_test |
| 41 | + |
| 42 | + permissions: |
| 43 | + id-token: write |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Download all the dists |
| 47 | + uses: actions/download-artifact@v5 |
| 48 | + with: |
| 49 | + name: python-package-distributions |
| 50 | + path: dist/ |
| 51 | + - name: Publish distribution to TestPyPI |
| 52 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 53 | + with: |
| 54 | + verbose: true |
| 55 | + |
| 56 | + # build-test: |
| 57 | + # name: Build distribution |
| 58 | + # runs-on: ubuntu-latest |
| 59 | + |
| 60 | + # steps: |
| 61 | + # - uses: actions/checkout@v5 |
| 62 | + # with: |
| 63 | + # persist-credentials: false |
| 64 | + # - name: Set up Python |
| 65 | + # uses: actions/setup-python@v6 |
| 66 | + # with: |
| 67 | + # python-version: "3.x" |
| 68 | + # - name: Update project |
| 69 | + # run: python3 ./util/make-test-project |
| 70 | + # - name: Install pypa/build |
| 71 | + # run: >- |
| 72 | + # python3 -m |
| 73 | + # pip install |
| 74 | + # build |
| 75 | + # --user |
| 76 | + # - name: Build a binary wheel and a source tarball |
| 77 | + # run: python3 -m build |
| 78 | + # - name: Store the distribution packages |
| 79 | + # uses: actions/upload-artifact@v4 |
| 80 | + # with: |
| 81 | + # name: python-test-package-distributions |
| 82 | + # path: dist/ |
| 83 | + |
| 84 | + # publish-to-testpypi: |
| 85 | + # name: Publish Python distribution to TestPyPI |
| 86 | + # needs: |
| 87 | + # - build-test |
| 88 | + # runs-on: ubuntu-latest |
| 89 | + |
| 90 | + # environment: |
| 91 | + # name: testpypi |
| 92 | + # url: https://test.pypi.org/p/dnspython_test |
| 93 | + |
| 94 | + # permissions: |
| 95 | + # id-token: write |
| 96 | + |
| 97 | + # steps: |
| 98 | + # - name: Download all the dists |
| 99 | + # uses: actions/download-artifact@v5 |
| 100 | + # with: |
| 101 | + # name: python-test-package-distributions |
| 102 | + # path: dist/ |
| 103 | + # - name: Publish distribution to TestPyPI |
| 104 | + # uses: pypa/gh-action-pypi-publish@release/v1 |
| 105 | + # with: |
| 106 | + # repository-url: https://test.pypi.org/legacy/ |
| 107 | + # verbose: true |
| 108 | + # attestations: false |
0 commit comments