Fix bug with warnings (#15) #30
This file contains 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: Python package | |
permissions: | |
contents: write | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
- name: Run linting | |
run: uv run pre-commit run --all-files | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
uv build | |
uv publish && echo "published=1" >> "$GITHUB_ENV" || echo "published=0" >> "$GITHUB_ENV" | |
- name: Check if published | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
if [ "$published" = "1" ]; then | |
echo "Published to PyPI" | |
else | |
echo "Failed to publish to PyPI" | |
exit 1 | |
fi | |
- name: Make release with docset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: | | |
This is a release for the ${{ github.ref }} tag. | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
append_body: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |