Bump version to 0.8.5 #26
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: Publish Package | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Verify version matches tag | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| TAG_VERSION=${GITHUB_REF#refs/tags/v} | |
| FILE_VERSION=$(grep -Pom1 '^\s*version\s*=\s*"\K[^"]+' pyproject.toml) | |
| if [ "$TAG_VERSION" != "$FILE_VERSION" ]; then | |
| echo "Version mismatch!" | |
| echo " Tag: v$TAG_VERSION" | |
| echo " File: $FILE_VERSION" | |
| exit 1 | |
| fi | |
| echo "Version check passed: $FILE_VERSION" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Build distributions | |
| run: | | |
| uv build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| retention-days: 1 | |
| if-no-files-found: error | |
| publish-pypi: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| if: | | |
| github.event_name == 'push' && | |
| startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/news-watch | |
| steps: | |
| - name: Download distributions | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| print-hash: true | |
| skip-existing: true | |
| attestations: true | |
| create-release: | |
| name: Create GitHub Release | |
| needs: [publish-pypi] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| - name: Extract release notes | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| uv run python scripts/release_notes.py "$VERSION" > release-notes.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: release-notes.md | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-beta') }} |