|
8 | 8 | jobs: |
9 | 9 | release-job: |
10 | 10 | runs-on: ubuntu-latest |
11 | | - env: |
12 | | - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
13 | 11 | steps: |
14 | | - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
15 | | - - name: Set up Python |
16 | | - uses: actions/setup-python@v5 |
17 | | - with: |
18 | | - python-version: 3.12 |
19 | | - - name: Install release tooling |
20 | | - run: | |
21 | | - pip install twine wheel numpy setuptools versioneer |
22 | | - - name: Build package |
23 | | - run: | |
24 | | - python setup.py sdist bdist_wheel |
25 | | - - name: Check version number match |
26 | | - run: | |
27 | | - echo "GITHUB_REF: ${GITHUB_REF}" |
28 | | - # The GITHUB_REF should be something like "refs/tags/v1.2.3" |
29 | | - # Make sure the package version is the same as the tag |
30 | | - grep -Rq "^Version: ${GITHUB_REF:11}$" gEconpy.egg-info/PKG-INFO |
31 | | - - name: Publish to PyPI |
32 | | - run: | |
33 | | - twine check dist/* |
34 | | - twine upload --repository pypi --username __token__ --password ${PYPI_TOKEN} dist/* |
35 | | - test-install-job: |
| 12 | + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 |
| 13 | + - name: Set up Python |
| 14 | + uses: actions/setup-python@v5 |
| 15 | + with: |
| 16 | + python-version: 3.12 |
| 17 | + - name: Install release tooling |
| 18 | + run: | |
| 19 | + pip install twine wheel numpy setuptools versioneer |
| 20 | + - name: Build package |
| 21 | + run: | |
| 22 | + python setup.py sdist bdist_wheel |
| 23 | + - name: Check version number match |
| 24 | + run: | |
| 25 | + echo "GITHUB_REF: ${GITHUB_REF}" |
| 26 | + # The GITHUB_REF should be something like "refs/tags/v1.2.3" |
| 27 | + # Make sure the package version is the same as the tag |
| 28 | + grep -Rq "^Version: ${GITHUB_REF:11}$" gEconpy.egg-info/PKG-INFO |
| 29 | + - uses: actions/upload-artifact@v4 |
| 30 | + with: |
| 31 | + name: bdist |
| 32 | + path: dist/* |
| 33 | + pypi-publish: |
36 | 34 | needs: release-job |
| 35 | + name: upload release to PyPI |
| 36 | + runs-on: ubuntu-latest |
| 37 | + permissions: |
| 38 | + id-token: write |
| 39 | + steps: |
| 40 | + - uses: actions/download-artifact@v4 |
| 41 | + with: |
| 42 | + name: bdist |
| 43 | + path: dist |
| 44 | + - name: Publish package distributions to PyPI |
| 45 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 46 | + test-install-job: |
| 47 | + needs: pypi-publish |
37 | 48 | runs-on: ubuntu-latest |
38 | 49 | steps: |
39 | 50 | - name: Set up Python |
40 | 51 | uses: actions/setup-python@v5 |
41 | 52 | with: |
42 | | - python-version: 3.7 |
| 53 | + python-version: 3.12 |
43 | 54 | - name: Give PyPI a chance to update the index |
44 | | - run: sleep 240 |
| 55 | + run: sleep 360 |
45 | 56 | - name: Install from PyPI |
46 | 57 | run: | |
47 | 58 | pip install gEconpy==${GITHUB_REF:11} |
0 commit comments