build(deps-dev): Bump coverage from 7.6.1 to 7.6.2 #165
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: Upload Python Package and Docker Container | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- created | |
jobs: | |
deploy: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Set __version__ and poetry version | |
if: github.event_name == 'release' | |
run: | | |
TAG="$(git describe --tags --abbrev=0)" | |
echo "__version__ = \"${TAG##*v}\"" > asu/__init__.py | |
poetry version "${TAG##*v}" | |
- name: Build and publish | |
if: github.event_name == 'release' | |
run: | | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
poetry publish --build | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: openwrt/asu | |
tags: | | |
type=semver,pattern={{version}} | |
latest | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push ASU to Docker Hub | |
uses: docker/build-push-action@v5 | |
with: | |
file: Containerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |