Roger Gonzalez 0761903379
All checks were successful
CI + Deploy / lint (push) Successful in 7s
CI + Deploy / test (push) Successful in 12s
CI + Deploy / deploy_to_pypi (push) Successful in 15s
CI + Deploy / deploy_to_registries (push) Successful in 33s
Bump version to 2.1.2
- Update project version to 2.1.2.
- Update pyproject.toml with the new version.
- Update README.md with a link to the CI badge.
- Modify ci.yml to deploy to PyPI after the test job.
2025-05-17 15:03:41 -03:00

92 lines
2.3 KiB
YAML

name: CI + Deploy
on:
push:
branches:
- master
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Run Ruff
run: |
uv venv .venv
source .venv/bin/activate
uv run ruff check
uv run ruff format --check
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Run Tests
run: |
uv venv .venv
source .venv/bin/activate
uv run pytest -v --cov=. --cov-report=xml
- name: Upload to Codecov
run: bash <(curl -s https://codecov.io/bash)
deploy_to_pypi:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
uv venv .venv
source .venv/bin/activate
uv pip install build twine
uv run python -m build
uv run python -m twine upload dist/*
deploy_to_registries:
runs-on: ubuntu-latest
needs: deploy_to_pypi
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
- name: Log in to Gitea Registry
run: echo "${{ secrets.REPOSITORY_TOKEN }}" | docker login git.rogs.me -u rogs --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push to both DockerHub and Gitea
run: |
docker buildx build --push \
--tag rogsme/subscleaner:latest \
--tag git.rogs.me/rogs/subscleaner:latest \
.