Still trying to get GitHub actions to work #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Publish ASMX to PyPI | |
| on: | |
| push: | |
| # Release tags go to PyPI | |
| tags: | |
| - 'release-*' | |
| branches: | |
| - main | |
| jobs: | |
| build-and-publish: | |
| name: Build and Publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip build | |
| - name: Build the package | |
| run: python -m build | |
| - name: Publish to PyPI or TestPyPI | |
| uses: pypa/gh-action-pypi-publish@v1.8.8 | |
| with: | |
| password: ${{ startsWith(github.ref, 'refs/tags/release-') && secrets.PYPI_API_TOKEN || secrets.TEST_PYPI_API_TOKEN }} | |
| repository-url: ${{ startsWith(github.ref, 'refs/tags/release-') && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }} |