Bump aiohttp from 3.8.5 to 3.11.2 #1024
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: Docker Build | |
on: | |
push: | |
release: | |
types: [published, prereleased] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build Docker Image | |
strategy: | |
matrix: | |
include: | |
- arch: linux/386 | |
hass_arch: i386 | |
- arch: linux/amd64 | |
hass_arch: amd64 | |
- arch: linux/arm/v6 | |
hass_arch: armv6 | |
- arch: linux/arm/v7 | |
hass_arch: armv7 | |
- arch: linux/arm64 | |
hass_arch: aarch64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
# https://github.com/crazy-max/ghaction-docker-buildx/issues/172 | |
- name: Hack Docker FS to Build cryptography on armv6/armv7 | |
if: ${{ matrix.hass_arch == 'armv6' || matrix.hass_arch == 'armv7' }} | |
run: | | |
set -x | |
df -h | |
sudo swapon --show | |
sudo dd if=/dev/zero of=/swapfile1 bs=1M count=6K | |
sudo chmod 600 /swapfile1 | |
sudo mkswap /swapfile1 | |
sudo swapon /swapfile1 | |
sudo swapon --show | |
sudo free -h | |
sudo systemctl stop docker | |
sudo mount -t tmpfs -o size=9G tmpfs /var/lib/docker | |
df -h | |
sudo systemctl start docker | |
- name: Cache Docker layers | |
uses: actions/[email protected] | |
continue-on-error: true | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ matrix.arch }}-${{ github.sha }} | |
restore-keys: | | |
${{ matrix.arch }}- | |
# label version as branch-run_number | |
- name: Build Branch | |
if: ${{ startsWith(github.ref, 'refs/heads/') }} | |
run: | | |
set -x | |
docker build \ | |
--build-arg HASS_ARCH=${{ matrix.hass_arch }} \ | |
--build-arg BUILD_VERSION=${GITHUB_REF##*/}-${{ github.run_number }} \ | |
--tag ci:${{ github.run_number }} \ | |
--platform ${{ matrix.arch }} \ | |
--progress plain \ | |
--file ./docker/Dockerfile \ | |
--cache-from type=local,src=/tmp/.buildx-cache \ | |
--cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max \ | |
--load \ | |
. | |
# label version as tag | |
- name: Build Tag | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
run: | | |
set -x | |
docker build \ | |
--build-arg HASS_ARCH=${{ matrix.hass_arch }} \ | |
--build-arg BUILD_VERSION=${GITHUB_REF##*/} \ | |
--tag ci:${{ github.run_number }} \ | |
--platform ${{ matrix.arch }} \ | |
--progress plain \ | |
--file ./docker/Dockerfile \ | |
--cache-from type=local,src=/tmp/.buildx-cache \ | |
--cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max \ | |
--load \ | |
. | |
# Temp fix | |
# https://github.com/docker/build-push-action/issues/252 | |
# https://github.com/moby/buildkit/issues/1896 | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
- name: Inspect | |
run: | | |
set -x | |
docker image inspect ci:${{ github.run_number }} | |
docker history --no-trunc ci:${{ github.run_number }} | |
- name: Save tarball | |
run: | | |
set -x | |
docker save --output ci-${{ matrix.hass_arch }}-${{ github.run_number }}.tar.gz ci:${{ github.run_number }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ci-${{ matrix.hass_arch }}-${{ github.run_number }} | |
path: ci-${{ matrix.hass_arch }}-${{ github.run_number }}.tar.gz | |
publish: | |
needs: build | |
name: Publish Image | |
runs-on: ubuntu-latest | |
if: ${{ !startsWith(github.ref, 'refs/pull/') && !startsWith(github.ref, 'refs/heads/dependabot/') }} | |
strategy: | |
matrix: | |
arch: [i386, amd64, armv6, armv7, aarch64] | |
registry: | |
- { | |
url: ghcr.io/hass-emulated-hue, | |
username: GCHR_USERNAME, | |
password: GHCR_PAT, | |
repo: ghcr.io/hass-emulated-hue/core, | |
} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download container artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ci-${{ matrix.arch }}-${{ github.run_number }} | |
- name: Import image | |
run: | | |
docker load --input ci-${{ matrix.arch }}-${{ github.run_number }}.tar.gz | |
- name: Docker login | |
run: | | |
docker login ${{ matrix.registry.url }} -u ${{ secrets[matrix.registry.username] }} -p ${{ secrets[matrix.registry.password] }} | |
- name: Push image | |
# if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: | | |
docker/publish.py \ | |
--tag ${GITHUB_REF##*/} \ | |
--repo ${{ matrix.registry.repo }} \ | |
--image \ | |
--ci \ | |
--arch ${{ matrix.arch }} \ | |
--image-name ci:${{ github.run_number }} \ | |
--latest | |
- name: Push image | |
# if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
if: ${{ github.ref != 'refs/heads/master' }} | |
run: | | |
docker/publish.py \ | |
--tag ${GITHUB_REF##*/} \ | |
--repo ${{ matrix.registry.repo }} \ | |
--image \ | |
--ci \ | |
--arch ${{ matrix.arch }} \ | |
--image-name ci:${{ github.run_number }} | |
create_manifest: | |
needs: publish | |
name: Create Manifest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
registry: | |
- { | |
url: ghcr.io/hass-emulated-hue, | |
username: GCHR_USERNAME, | |
password: GHCR_PAT, | |
repo: ghcr.io/hass-emulated-hue/core, | |
} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Enable Experimental Docker Features | |
run: | | |
export DOCKER_CLI_EXPERIMENTAL="enabled" | |
echo "DOCKER_CLI_EXPERIMENTAL=${DOCKER_CLI_EXPERIMENTAL}" >> $GITHUB_ENV | |
- name: Docker login | |
run: | | |
docker login ${{ matrix.registry.url }} -u ${{ secrets[matrix.registry.username] }} -p ${{ secrets[matrix.registry.password] }} | |
- name: Create Manifest | |
# if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
if: ${{ github.ref == 'refs/heads/master' }} | |
run: | | |
docker/publish.py \ | |
--tag ${GITHUB_REF##*/} \ | |
--repo ${{ matrix.registry.repo }} \ | |
--manifest \ | |
--ci \ | |
--latest | |
- name: Create Manifest | |
# if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
if: ${{ github.ref != 'refs/heads/master' }} | |
run: | | |
docker/publish.py \ | |
--tag ${GITHUB_REF##*/} \ | |
--repo ${{ matrix.registry.repo }} \ | |
--manifest \ | |
--ci |