|
5 | 5 | types: |
6 | 6 | - published |
7 | 7 |
|
8 | | - |
9 | 8 | jobs: |
10 | 9 | build: |
11 | | - |
| 10 | + name: Build distribution 📦 |
12 | 11 | runs-on: ubuntu-latest |
13 | 12 |
|
14 | 13 | steps: |
15 | | - - uses: actions/checkout@v4 |
16 | | - with: |
17 | | - persist-credentials: false |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + persist-credentials: false |
| 17 | + |
| 18 | + - name: Install python |
| 19 | + uses: actions/setup-python@v5 |
| 20 | + with: |
| 21 | + python-version: "3.12" |
| 22 | + |
| 23 | + - name: Install build tools |
| 24 | + run: | |
| 25 | + python -m pip install --upgrade pip build twine |
| 26 | +
|
| 27 | + - name: Build package |
| 28 | + run: python -m build |
| 29 | + |
| 30 | + - name: Check package metadata |
| 31 | + run: twine check dist/* |
18 | 32 |
|
19 | | - - name: Install python |
20 | | - uses: actions/setup-python@v5 |
21 | | - with: |
22 | | - python-version: '3.12' |
| 33 | + - uses: actions/upload-artifact@v4 |
| 34 | + with: |
| 35 | + name: DoubleML-pkg |
| 36 | + path: dist/ |
23 | 37 |
|
24 | | - - name: Install build tools |
25 | | - run: | |
26 | | - python -m pip install --upgrade pip build twine |
| 38 | + publish-to-testpypi: |
| 39 | + name: Publish to TestPyPI 🧪 |
| 40 | + needs: build |
| 41 | + runs-on: ubuntu-latest |
| 42 | + environment: |
| 43 | + name: testpypi |
| 44 | + url: https://test.pypi.org/p/DoubleML |
| 45 | + permissions: |
| 46 | + id-token: write |
| 47 | + |
| 48 | + steps: |
| 49 | + - name: Download built package |
| 50 | + uses: actions/download-artifact@v4 |
| 51 | + with: |
| 52 | + name: DoubleML-pkg |
| 53 | + path: dist/ |
27 | 54 |
|
28 | | - - name: Build package |
29 | | - run: python -m build |
| 55 | + - name: Publish to TestPyPI |
| 56 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 57 | + with: |
| 58 | + repository-url: https://test.pypi.org/legacy/ |
30 | 59 |
|
31 | | - - name: Check package metadata |
32 | | - run: twine check dist/* |
| 60 | + publish-to-pypi: |
| 61 | + name: Publish to PyPI 🚀 |
| 62 | + needs: publish-to-testpypi |
| 63 | + runs-on: ubuntu-latest |
| 64 | + environment: |
| 65 | + name: pypi |
| 66 | + url: https://pypi.org/p/DoubleML |
| 67 | + permissions: |
| 68 | + id-token: write |
| 69 | + |
| 70 | + steps: |
| 71 | + - name: Download built package |
| 72 | + uses: actions/download-artifact@v4 |
| 73 | + with: |
| 74 | + name: DoubleML-pkg |
| 75 | + path: dist/ |
33 | 76 |
|
34 | | - - uses: actions/upload-artifact@v4 |
35 | | - with: |
36 | | - name: DoubleML-pkg |
37 | | - path: dist/ |
| 77 | + - name: Publish to PyPI |
| 78 | + uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments