|
1 | 1 | name: Deploy release |
2 | 2 | on: |
3 | 3 | push: |
4 | | - tags: # run only on new tags that follow semver MAJOR.MINOR.PATCH |
5 | | - - '[0-9]+.[0-9]+.[0-9]+' |
| 4 | + tags: |
| 5 | + - '^v\d+(\.\d+)*(\.[0-9A-Za-z]*)*' |
6 | 6 |
|
7 | 7 | jobs: |
| 8 | + common-actions: |
| 9 | + name: Run PR Workflow |
| 10 | + uses: ./.github/workflows/github-actions-ci.yml |
| 11 | + secrets: inherit |
| 12 | + |
8 | 13 | deploy-release: |
| 14 | + needs: |
| 15 | + - common-actions |
9 | 16 | name: Deploy release from tag |
10 | 17 | runs-on: ubuntu-latest |
11 | 18 | steps: |
12 | | - - name: Checkout repo with submodules |
| 19 | + - name: Checkout repo |
13 | 20 | uses: actions/checkout@v4 |
14 | 21 | with: |
15 | | - submodules: 'recursive' |
16 | | - fetch-depth: 0 # tags are required for versioneer to determine the version |
| 22 | + fetch-depth: 0 |
17 | 23 |
|
18 | 24 | - name: Set up Python |
19 | 25 | uses: actions/setup-python@v5 |
20 | 26 | with: |
21 | | - python-version: '3.13' |
| 27 | + # this should be the lowest supported version |
| 28 | + python-version: '3.10' |
22 | 29 |
|
23 | 30 | - name: Install build dependencies |
24 | 31 | run: | |
25 | | - python -m pip install --upgrade pip |
26 | | - python -m pip install tox |
27 | | - python -m pip list |
28 | | -
|
29 | | - - name: Run tox tests |
30 | | - run: | |
31 | | - tox -e py312-upgraded |
| 32 | + pip install --upgrade pip |
| 33 | + pip install hatch |
| 34 | + pip list |
32 | 35 |
|
33 | 36 | - name: Build wheel and source distribution |
34 | 37 | run: | |
35 | | - tox -e build-py312-upgraded |
| 38 | + hatch build |
36 | 39 | ls -1 dist |
37 | 40 |
|
38 | | - - name: Test installation from a wheel |
39 | | - run: | |
40 | | - tox -e wheelinstall --recreate --installpkg dist/*-none-any.whl |
41 | | -
|
42 | 41 | - name: Upload wheel and source distributions to PyPI |
43 | 42 | run: | |
44 | 43 | pip install twine |
45 | 44 | ls -1 dist |
46 | | - # twine upload --repository-url https://test.pypi.org/legacy/ -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/* |
47 | | - twine upload -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/* |
| 45 | + # our current token does not work on testpypi |
| 46 | + # twine upload -r testpypi -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing dist/* |
| 47 | + twine upload -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing dist/* |
48 | 48 |
|
49 | | - - name: Publish wheel and source distributions as a GitHub release |
50 | | - run: | |
51 | | - python -m pip install "githubrelease>=1.5.9" |
52 | | - githubrelease --github-token ${{ secrets.BOT_GITHUB_TOKEN }} release NeurodataWithoutBorders/pynwb \ |
53 | | - create ${{ github.ref_name }} --name ${{ github.ref_name }} \ |
54 | | - --publish dist/* |
| 49 | + - name: Keep packages |
| 50 | + uses: actions/upload-artifact@v4 |
| 51 | + if: ${{ failure() }} |
| 52 | + with: |
| 53 | + name: pypi-wheel-and-sdist |
| 54 | + path: | |
| 55 | + dist/* |
| 56 | + if-no-files-found: error |
0 commit comments