Skip to content

Commit 5aef15e

Browse files
ci: ⚡️ Improve matrix and add latest tag (#168)
1 parent 491c8ec commit 5aef15e

File tree

1 file changed

+20
-39
lines changed

1 file changed

+20
-39
lines changed

.github/workflows/publish-idf-rust-tags.yml

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,33 @@ on:
1414

1515
jobs:
1616
esp-idf:
17+
name: ${{ matrix.board }}_${{ matrix.esp-idf.name }}_${{ github.event.inputs.toolchain-version }} tag
1718
runs-on: ubuntu-latest
1819
strategy:
1920
fail-fast: false
2021
matrix:
2122
board: ["esp32", "esp32s2", "esp32s3", "esp32c3", "all"]
22-
# esp-idf: ["master", "v4.4"]
23-
# Use only v4.4 as master is failing due to: https://github.com/esp-rs/esp-idf-sys/issues/99
24-
esp-idf: ["v4.4"]
23+
esp-idf:
24+
- name: v4.4
25+
branch: release/v4.4
26+
template-name: v4.4
27+
# - name: master
28+
# branch: master
29+
# template-name: mainline
2530
steps:
2631
- name: Checkout
2732
uses: actions/checkout@v2
28-
- name: Build Docker image (master)
29-
if: matrix.esp-idf == 'master' && matrix.board != 'all'
30-
run: |
31-
docker image build --tag idf-rust:${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }} \
32-
--file idf-rust.Containerfile --build-arg XTENSA_TOOLCHAIN_VERSION=${{ github.event.inputs.toolchain-version }} \
33-
--build-arg ESP_IDF_VERSION=${{ matrix.esp-idf }} --build-arg ESP_BOARD=${{ matrix.board }} .
34-
- name: Build Docker image (v4.4)
35-
if: matrix.esp-idf == 'v4.4' && matrix.board != 'all'
33+
- name: Build Docker image
34+
if: matrix.board != 'all'
3635
run: |
37-
docker image build --tag idf-rust:${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }} \
36+
docker image build --tag idf-rust:${{ matrix.board }}_${{ matrix.esp-idf.name }}_${{ github.event.inputs.toolchain-version }} \
3837
--file idf-rust.Containerfile --build-arg XTENSA_TOOLCHAIN_VERSION=${{ github.event.inputs.toolchain-version }} \
39-
--build-arg ESP_IDF_VERSION=release/v4.4 --build-arg ESP_BOARD=${{ matrix.board }} .
40-
- name: Build template project using generated tag (master)
41-
if: matrix.esp-idf == 'master' && matrix.board != 'all'
38+
--build-arg ESP_IDF_VERSION=${{ matrix.esp-idf.branch }} --build-arg ESP_BOARD=${{ matrix.board }} .
39+
- name: Build template project using generated tag
40+
if: matrix.board != 'all'
4241
run: |
4342
docker run --user esp --mount type=bind,source="$(pwd)/build-template-project.sh",target=/workspace/build-template-project.sh,consistency=cached \
44-
--rm idf-rust:${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }} /bin/bash /workspace/build-template-project.sh esp-idf-template ${{ matrix.board }} mainline
45-
- name: Build template project using generated tag (v4.4)
46-
if: matrix.esp-idf == 'v4.4' && matrix.board != 'all'
47-
run: |
48-
docker run --mount type=bind,source="$(pwd)/build-template-project.sh",target=/workspace/build-template-project.sh,consistency=cached \
49-
--rm idf-rust:${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }} /bin/bash /workspace/build-template-project.sh esp-idf-template ${{ matrix.board }} ${{ matrix.esp-idf }}
43+
--rm idf-rust:${{ matrix.board }}_${{ matrix.esp-idf.name }}_${{ github.event.inputs.toolchain-version }} /bin/bash /workspace/build-template-project.sh esp-idf-template ${{ matrix.board }} ${{ matrix.esp-idf.template-name }}
5044
- name: Set up QEMU
5145
uses: docker/setup-qemu-action@v1
5246
- name: Set up Docker Buildx
@@ -56,33 +50,20 @@ jobs:
5650
with:
5751
username: ${{ secrets.DOCKER_USERNAME }}
5852
password: ${{ secrets.DOCKER_TOKEN }}
59-
- name: Build - ${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }} tag (v4.4)
60-
uses: docker/build-push-action@v2
61-
if: matrix.esp-idf == 'v4.4'
62-
with:
63-
context: .
64-
file: idf-rust.Containerfile
65-
build-args: |
66-
XTENSA_TOOLCHAIN_VERSION=${{ github.event.inputs.toolchain-version }}
67-
ESP_IDF_VERSION=release/v4.4
68-
ESP_BOARD=${{ matrix.board }}
69-
tags: espressif/idf-rust:${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }}
70-
push: true
71-
platforms: linux/amd64, linux/arm64
72-
- name: Build - ${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }} tag (mater)
53+
- name: Build and publish tag
7354
uses: docker/build-push-action@v2
74-
if: matrix.esp-idf == 'master'
7555
with:
7656
context: .
7757
file: idf-rust.Containerfile
7858
build-args: |
7959
XTENSA_TOOLCHAIN_VERSION=${{ github.event.inputs.toolchain-version }}
80-
ESP_IDF_VERSION=${{ matrix.esp-idf }}
60+
ESP_IDF_VERSION=${{ matrix.esp-idf.branch }}
8161
ESP_BOARD=${{ matrix.board }}
82-
tags: espressif/idf-rust:${{ matrix.board }}_${{ matrix.esp-idf }}_${{ github.event.inputs.toolchain-version }}
62+
tags: espressif/idf-rust:${{ matrix.board }}_${{ matrix.esp-idf.name }}_${{ github.event.inputs.toolchain-version }},espressif/idf-rust:${{ matrix.board }}_${{ matrix.esp-idf.name }}_latest
8363
push: true
8464
platforms: linux/amd64, linux/arm64
8565
bare-metal:
66+
name: ${{ matrix.board }}_${{ github.event.inputs.toolchain-version }} tag
8667
runs-on: ubuntu-latest
8768
strategy:
8869
fail-fast: false
@@ -119,6 +100,6 @@ jobs:
119100
build-args: |
120101
XTENSA_TOOLCHAIN_VERSION=${{ github.event.inputs.toolchain-version }}
121102
ESP_BOARD=${{ matrix.board }}
122-
tags: espressif/idf-rust:${{ matrix.board }}_${{ github.event.inputs.toolchain-version }}
103+
tags: espressif/idf-rust:${{ matrix.board }}_${{ github.event.inputs.toolchain-version }},espressif/idf-rust:${{ matrix.board }}_latest
123104
push: true
124105
platforms: linux/amd64, linux/arm64

0 commit comments

Comments
 (0)