Repository navigation
search1api v0.1.0 #1
Workflow file for this run
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: Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Verify release tag | |
| env: | |
| RELEASE_TAG: ${{ github.event.release.tag_name }} | |
| run: >- | |
| python -c "import os; from pathlib import Path; | |
| version = next(line.split('=', 1)[1].strip().strip(chr(34)) | |
| for line in Path('pyproject.toml').read_text().splitlines() | |
| if line.startswith('version = ')); | |
| assert os.environ['RELEASE_TAG'] == 'v' + version, | |
| 'Release tag must be v' + version" | |
| - run: python -m pip install build twine | |
| - run: python -m build | |
| - run: python -m twine check dist/* | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| if-no-files-found: error | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/search1api | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |