|
1 | 1 | name: Build |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: |
4 | 5 | release: |
5 | 6 | types: [published] |
6 | 7 | push: |
|
16 | 17 |
|
17 | 18 | jobs: |
18 | 19 | build: |
19 | | - runs-on: ubuntu-18.04 |
| 20 | + runs-on: ubuntu-latest |
20 | 21 | strategy: |
21 | 22 | fail-fast: false |
22 | 23 | matrix: |
23 | | - python-version: [3.8, 3.9, "3.10", "3.11"] |
| 24 | + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] |
24 | 25 |
|
25 | 26 | steps: |
26 | 27 | - uses: actions/checkout@v1 |
@@ -59,39 +60,50 @@ jobs: |
59 | 60 | bash <(curl -s https://codecov.io/bash) |
60 | 61 |
|
61 | 62 | - name: Install distribution dependencies |
62 | | - run: pip install --upgrade twine setuptools wheel |
63 | | - if: matrix.python-version == 3.8 || matrix.python-version == 3.9 |
| 63 | + run: pip install build |
| 64 | + if: matrix.python-version == 3.12 |
64 | 65 |
|
65 | 66 | - name: Create distribution package |
66 | | - run: python setup.py sdist bdist_wheel |
67 | | - if: matrix.python-version == 3.8 || matrix.python-version == 3.9 |
| 67 | + run: python -m build |
| 68 | + if: matrix.python-version == 3.12 |
68 | 69 |
|
69 | 70 | - name: Upload distribution package |
70 | | - uses: actions/upload-artifact@master |
| 71 | + uses: actions/upload-artifact@v4 |
71 | 72 | with: |
72 | | - name: dist-package-${{ matrix.python-version }} |
| 73 | + name: dist |
73 | 74 | path: dist |
74 | | - if: matrix.python-version == 3.8 || matrix.python-version == 3.9 |
| 75 | + if: matrix.python-version == 3.12 |
75 | 76 |
|
76 | 77 | publish: |
77 | | - runs-on: ubuntu-18.04 |
| 78 | + runs-on: ubuntu-latest |
78 | 79 | needs: build |
79 | | - if: github.event_name == 'release' |
| 80 | + if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' |
80 | 81 | steps: |
81 | 82 | - name: Download a distribution artifact |
82 | | - uses: actions/download-artifact@v2 |
| 83 | + uses: actions/download-artifact@v4 |
83 | 84 | with: |
84 | | - name: dist-package-3.9 |
| 85 | + name: dist |
85 | 86 | path: dist |
86 | | - - name: Publish distribution 📦 to Test PyPI |
87 | | - uses: pypa/gh-action-pypi-publish@master |
| 87 | + |
| 88 | + - name: Use Python 3.12 |
| 89 | + uses: actions/setup-python@v1 |
88 | 90 | with: |
89 | | - skip_existing: true |
90 | | - user: __token__ |
91 | | - password: ${{ secrets.test_pypi_password }} |
92 | | - repository_url: https://test.pypi.org/legacy/ |
| 91 | + python-version: '3.12' |
| 92 | + |
| 93 | + - name: Install dependencies |
| 94 | + run: | |
| 95 | + pip install twine |
| 96 | +
|
| 97 | + - name: Publish distribution 📦 to Test PyPI |
| 98 | + run: | |
| 99 | + twine upload -r testpypi dist/* |
| 100 | + env: |
| 101 | + TWINE_USERNAME: __token__ |
| 102 | + TWINE_PASSWORD: ${{ secrets.test_pypi_password }} |
| 103 | + |
93 | 104 | - name: Publish distribution 📦 to PyPI |
94 | | - uses: pypa/gh-action-pypi-publish@master |
95 | | - with: |
96 | | - user: __token__ |
97 | | - password: ${{ secrets.pypi_password }} |
| 105 | + run: | |
| 106 | + twine upload -r pypi dist/* |
| 107 | + env: |
| 108 | + TWINE_USERNAME: __token__ |
| 109 | + TWINE_PASSWORD: ${{ secrets.pypi_password }} |
0 commit comments