Skip to content

release

release #2

Workflow file for this run

name: release
on:
push:
branches: ["master"]
paths:
- 'src/**'
workflow_dispatch:
env:
DOCKER_REPOSITORY: ${{github.repository}}
jobs:
release-docker:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
idf_image_tag:
- v5.3
- v4.4.8
env:
DOCKER_PLATFORM: "linux/amd64"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
platforms: ${{env.DOCKER_PLATFORM}}
version: latest
- name: Docker Meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{env.DOCKER_REPOSITORY}}
labels: |
maintainer=${{github.repository_owner}}
org.opencontainers.image.description=ESP-IDF ${{matrix.idf_image_tag}} image with Sonar Cloud support
org.opencontainers.image.vendor=${{github.repository_owner}}
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_TOKEN}}
- name: Build
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:src"
cache-from: type=gha
cache-to: type=gha,mode=min
load: true
platforms: ${{env.DOCKER_PLATFORM}}
tags: ${{env.DOCKER_REPOSITORY}}:${{matrix.idf_image_tag}}
labels: ${{steps.meta.outputs.labels}}
build-args: |
IDF_IMAGE_TAG=${{matrix.idf_image_tag}}
SONAR_SCANNER_VERSION=${{vars.SONAR_SCANNER_VERSION}}
- name: Create Test Project
run: |
mkdir ${{github.workspace}}/${{matrix.idf_image_tag}}
docker run --rm -v ${{github.workspace}}/${{matrix.idf_image_tag}}:/project -w /project ${{env.DOCKER_REPOSITORY}}:${{matrix.idf_image_tag}} idf.py create-project-from-example "espressif/esp-now=*:coin_cell_demo/bulb"
- name: Build Test Project
run: docker run --rm -v ${{github.workspace}}/${{matrix.idf_image_tag}}:/project -w /project ${{env.DOCKER_REPOSITORY}}:${{matrix.idf_image_tag}} idf.py build -C ./bulb
- name: Push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:src"
push: true
platforms: ${{env.DOCKER_PLATFORM}}
tags: ${{env.DOCKER_REPOSITORY}}:${{matrix.idf_image_tag}}
labels: ${{steps.meta.outputs.labels}}
build-args: |
IDF_IMAGE_TAG=${{matrix.idf_image_tag}}
SONAR_SCANNER_VERSION=${{vars.SONAR_SCANNER_VERSION}}
release-description:
runs-on: ubuntu-latest
needs: [release-docker]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_TOKEN}}
repository: ${{env.DOCKER_REPOSITORY}}