diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c64fc35 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,96 @@ +# Hide sublime text stuff +*.sublime-project +*.sublime-workspace + +# Hide some OS X stuff +.DS_Store +.AppleDouble +.LSOverride +Icon + +# Thumbnails +._* + +# IntelliJ IDEA +.idea +*.iml + +# pytest +.pytest_cache +.cache + +# GITHUB Proposed Python stuff: +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +.eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Logs +*.log +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml +htmlcov/ + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +.python-version + +# emacs auto backups +*~ +*# +*.orig + +# venv stuff +pyvenv.cfg +pip-selfcheck.json +venv +.venv +Pipfile* +share/* + +# vimmy stuff +*.swp +*.swo + +ctags.tmp + +# Visual Studio Code +.vscode + +# Built docs +docs/build + +# Windows Explorer +desktop.ini +/.vs/* + +# mypy +/.mypy_cache/* + +.git* diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b38df29..b728efb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,7 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..815daeb --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,49 @@ +name: Build docker image on changes + +on: + push: + branches: + - main + paths: + - Dockerfile + - requirements_test.txt + + +jobs: + build-image: + runs-on: ubuntu-latest + name: Build and push Docker image + steps: + - + name: Checkout source code + uses: actions/checkout@v2.3.4 + - + name: Log in to docker hub + uses: docker/login-action@v1.10.0 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASSWORD }} + - + name: Log in to the GitHub container registry + uses: docker/login-action@v1.10.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1.2.0 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1.5.1 + - + name: Build and Push + uses: docker/build-push-action@v2.6.1 + with: + context: . + tags: | + ghcr.io/esphome/aioesphomeapi-proto-builder:latest + esphome/aioesphomeapi-proto-builder:latest + push: true + pull: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5231c7e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3.9 + +RUN apt-get update && \ + apt-get install -y protobuf-compiler + +WORKDIR /aioesphomeapi + +COPY requirements_test.txt ./ + +RUN pip3 install -r requirements_test.txt + +CMD ["script/gen-protoc"] + +LABEL \ + org.opencontainers.image.title="aioesphomeapi protobuf generator" \ + org.opencontainers.image.description="An image to help with ESPHomes aioesphomeapi protobuf generation" \ + org.opencontainers.image.vendor="ESPHome" \ + org.opencontainers.image.licenses="MIT" \ + org.opencontainers.image.url="https://esphome.io" \ + org.opencontainers.image.source="https://github.com/esphome/aioesphomeapi" \ + org.opencontainers.image.documentation="https://github.com/esphome/aioesphomeapi/blob/main/README.md"