|
1 | | -# SPDX-FileCopyrightText: 2019 ladyada for Adafruit Industries |
| 1 | +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries |
2 | 2 | # |
3 | | -# SPDX-License-Identifier: Unlicense |
| 3 | +# SPDX-License-Identifier: MIT |
4 | 4 |
|
5 | 5 | name: Release Actions |
6 | 6 |
|
@@ -61,25 +61,28 @@ jobs: |
61 | 61 | runs-on: ubuntu-latest |
62 | 62 | steps: |
63 | 63 | - uses: actions/checkout@v1 |
64 | | - - name: Check For setup.py |
| 64 | + - name: Check For pyproject.toml |
65 | 65 | id: need-pypi |
66 | 66 | run: | |
67 | | - echo ::set-output name=setup-py::$( find . -wholename './setup.py' ) |
| 67 | + echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) |
68 | 68 | - name: Set up Python |
69 | | - if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') |
| 69 | + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') |
70 | 70 | uses: actions/setup-python@v2 |
71 | 71 | with: |
72 | 72 | python-version: '3.x' |
73 | 73 | - name: Install dependencies |
74 | | - if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') |
| 74 | + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') |
75 | 75 | run: | |
76 | 76 | python -m pip install --upgrade pip |
77 | | - pip install setuptools wheel twine |
| 77 | + pip install --upgrade build twine |
78 | 78 | - name: Build and publish |
79 | | - if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') |
| 79 | + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') |
80 | 80 | env: |
81 | 81 | TWINE_USERNAME: ${{ secrets.pypi_username }} |
82 | 82 | TWINE_PASSWORD: ${{ secrets.pypi_password }} |
83 | 83 | run: | |
84 | | - python setup.py sdist |
| 84 | + for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do |
| 85 | + sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file; |
| 86 | + done; |
| 87 | + python -m build |
85 | 88 | twine upload dist/* |
0 commit comments