Publish IDF-Rust Tags #144
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: Publish IDF-Rust Tags | |
on: | |
workflow_dispatch: | |
inputs: | |
toolchain-version: | |
description: "Version of Rust toolchain" | |
required: true | |
default: "1.75.0.0" | |
publish: | |
description: "Publish the tags to Dockehub?" | |
required: true | |
default: "true" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
bare-metal: | |
name: ${{ matrix.board }}_${{ github.event.inputs.toolchain-version }} tag | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
board: ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s2", "esp32s3", "all"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build Docker image | |
if: matrix.board != 'all' | |
run: | | |
docker image build --tag idf-rust:${{ matrix.board }}_${{ github.event.inputs.toolchain-version }} \ | |
--file idf-rust.Containerfile --build-arg ESP_BOARD=${{ matrix.board }} --build-arg XTENSA_VERSION=${{ github.event.inputs.toolchain-version }} --build-arg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} . | |
- name: Build template projects using generated tag | |
if: matrix.board != 'all' | |
run: | | |
docker run --user esp --mount type=bind,source="$(pwd)/build-template-project.sh",target=/workspace/build-template-project.sh,consistency=cached \ | |
--rm idf-rust:${{ matrix.board }}_${{ github.event.inputs.toolchain-version }} /bin/bash /workspace/build-template-project.sh ${{ matrix.board }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build - ${{ matrix.board }}_${{ github.event.inputs.toolchain-version }} tag | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: idf-rust.Containerfile | |
build-args: | | |
ESP_BOARD=${{ matrix.board }} | |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
XTENSA_VERSION=${{ github.event.inputs.toolchain-version }} | |
tags: espressif/idf-rust:${{ matrix.board }}_${{ github.event.inputs.toolchain-version }},espressif/idf-rust:${{ matrix.board }}_latest | |
push: ${{ github.event.inputs.publish }} | |
platforms: linux/amd64, linux/arm64 |