Fixed docs. #25
Workflow file for this run
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: CI | |
on: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
test-and-build: | |
name: Test and build package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- uses: yezz123/setup-uv@v4 | |
with: | |
uv-venv: venv | |
- name: Install dependencies | |
run: uv pip install -e . -r pyproject.toml --extra=dev build | |
- name: Run tests | |
run: pytest | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Build package | |
run: python -m build | |
- name: Upload package distributions as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/* | |
if: startsWith(github.ref, 'refs/tags/v') | |
release-pypi: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Publish PyPI release | |
runs-on: ubuntu-latest | |
needs: test-and-build | |
environment: | |
name: pypi | |
url: https://pypi.org/p/boomgate | |
permissions: | |
id-token: write | |
steps: | |
- name: Download distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
release-github: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Publish GitHub release | |
runs-on: ubuntu-latest | |
needs: test-and-build | |
permissions: | |
contents: write | |
steps: | |
- name: Download distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Determine if the tag is a pre-release | |
id: prerelease_check | |
run: | | |
# Check if the tag matches the pre-release pattern | |
if [[ ${GITHUB_REF_NAME} =~ (a|b|rc)[0-9]+$ ]]; then | |
echo "::set-output name=prerelease::true" | |
else | |
echo "::set-output name=prerelease::false" | |
fi | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
fail_on_unmatched_files: true | |
prerelease: ${{ steps.prerelease_check.outputs.prerelease }} |