|
1 | | - |
2 | | -# This workflow will upload a Python Package using Twine when a release is created |
3 | | -# For more information see: https://github.com/pypa/gh-action-pypi-publish#trusted-publishing |
4 | | - |
5 | | -# This workflow uses actions that are not certified by GitHub. |
6 | | -# They are provided by a third-party and are governed by |
7 | | -# separate terms of service, privacy policy, and support |
8 | | -# documentation. |
9 | | - |
10 | | -name: Upload Python Package |
11 | | - |
12 | 1 | on: push |
13 | | - |
14 | 2 | jobs: |
15 | | - build: |
16 | | - name: Build distribution |
| 3 | + pypi-publish: |
| 4 | + name: Upload release to PyPI |
17 | 5 | runs-on: ubuntu-latest |
18 | | - |
19 | | - steps: |
20 | | - - uses: actions/checkout@v4 |
21 | | - with: |
22 | | - persist-credentials: false |
23 | | - - name: Set up Python |
24 | | - uses: actions/setup-python@v5 |
25 | | - with: |
26 | | - python-version: "3.x" |
27 | | - - name: Install pypa/build |
28 | | - run: >- |
29 | | - python3 -m |
30 | | - pip install |
31 | | - build |
32 | | - --user |
33 | | - - name: Build a binary wheel and a source tarball |
34 | | - run: python3 -m build |
35 | | - - name: Store the distribution packages |
36 | | - uses: actions/upload-artifact@v4 |
37 | | - with: |
38 | | - name: python-package-distributions |
39 | | - path: dist/ |
40 | | - |
41 | | - publish-to-testpypi: |
42 | | - name: Publish Python distribution to TestPyPI |
43 | | - needs: |
44 | | - - build |
45 | | - runs-on: ubuntu-latest |
46 | | - |
47 | | - environment: |
48 | | - name: testpypi |
49 | | - # url: https://test.pypi.org/p/mcd-regression |
50 | | - |
| 6 | + environment: release |
51 | 7 | permissions: |
52 | | - id-token: write # IMPORTANT: mandatory for trusted publishing |
53 | | - |
| 8 | + id-token: write |
54 | 9 | steps: |
55 | | - - name: Download all the dists |
56 | | - uses: actions/download-artifact@v4 |
57 | | - with: |
58 | | - name: python-package-distributions |
59 | | - path: dist/ |
60 | | - - name: Publish distribution to TestPyPI |
61 | | - uses: pypa/gh-action-pypi-publish@release/v1 |
62 | | - with: |
63 | | - repository-url: https://test.pypi.org/legacy/ |
| 10 | + - name: Checkout Source |
| 11 | + uses: actions/checkout@v4 |
| 12 | + - name: Build Package |
| 13 | + run: | |
| 14 | + python3 -m pip install --upgrade pip build |
| 15 | + python3 -m build |
| 16 | + - name: Publish to TestPyPi |
| 17 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 18 | + with: |
| 19 | + repository-url: https://test.pypi.org/mcd-regression/ |
0 commit comments