From f6fe4ab73ca239da9833375fc84cd15a81827e84 Mon Sep 17 00:00:00 2001 From: muXxer Date: Wed, 13 Nov 2024 20:29:09 +0100 Subject: [PATCH] feat(workflow): add toolchain version to docker build workflow --- .github/workflows/release_docker.yml | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/release_docker.yml b/.github/workflows/release_docker.yml index b3d723d801b..6db0a772919 100644 --- a/.github/workflows/release_docker.yml +++ b/.github/workflows/release_docker.yml @@ -35,6 +35,15 @@ jobs: - name: Checkout code uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - name: Read Rust toolchain version from TOML + id: read_toolchain + run: | + TOOLCHAIN_VERSION=$(grep -oE 'channel = "[^"]+' ./rust-toolchain.toml | sed 's/channel = "//') + echo "TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> $GITHUB_ENV + + - name: Log Rust toolchain version + run: echo "Rust toolchain version is ${{ env.TOOLCHAIN_VERSION }}" + - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 @@ -81,6 +90,8 @@ jobs: ssh: default context: . file: docker/iota-node/Dockerfile + build-args: | + RUST_IMAGE_VERSION=${{ env.TOOLCHAIN_VERSION }}-bookworm platforms: linux/amd64 tags: ${{ steps.meta-node.outputs.tags }} push: true @@ -94,6 +105,15 @@ jobs: - name: Checkout code uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - name: Read Rust toolchain version from TOML + id: read_toolchain + run: | + TOOLCHAIN_VERSION=$(grep -oE 'channel = "[^"]+' ./rust-toolchain.toml | sed 's/channel = "//') + echo "TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> $GITHUB_ENV + + - name: Log Rust toolchain version + run: echo "Rust toolchain version is ${{ env.TOOLCHAIN_VERSION }}" + - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 @@ -140,6 +160,8 @@ jobs: ssh: default context: . file: docker/iota-indexer/Dockerfile + build-args: | + RUST_IMAGE_VERSION=${{ env.TOOLCHAIN_VERSION }}-bookworm platforms: linux/amd64 tags: ${{ steps.meta-indexer.outputs.tags }} push: true @@ -153,6 +175,15 @@ jobs: - name: Checkout code uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - name: Read Rust toolchain version from TOML + id: read_toolchain + run: | + TOOLCHAIN_VERSION=$(grep -oE 'channel = "[^"]+' ./rust-toolchain.toml | sed 's/channel = "//') + echo "TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> $GITHUB_ENV + + - name: Log Rust toolchain version + run: echo "Rust toolchain version is ${{ env.TOOLCHAIN_VERSION }}" + - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 @@ -199,6 +230,8 @@ jobs: ssh: default context: . file: docker/iota-tools/Dockerfile + build-args: | + RUST_IMAGE_VERSION=${{ env.TOOLCHAIN_VERSION }}-bookworm platforms: linux/amd64 tags: ${{ steps.meta-tools.outputs.tags }} push: true @@ -212,6 +245,15 @@ jobs: - name: Checkout code uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 + - name: Read Rust toolchain version from TOML + id: read_toolchain + run: | + TOOLCHAIN_VERSION=$(grep -oE 'channel = "[^"]+' ./rust-toolchain.toml | sed 's/channel = "//') + echo "TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> $GITHUB_ENV + + - name: Log Rust toolchain version + run: echo "Rust toolchain version is ${{ env.TOOLCHAIN_VERSION }}" + - name: Set up QEMU uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # pin@v3 @@ -258,6 +300,8 @@ jobs: ssh: default context: . file: docker/iota-graphql-rpc/Dockerfile + build-args: | + RUST_IMAGE_VERSION=${{ env.TOOLCHAIN_VERSION }}-bookworm platforms: linux/amd64 tags: ${{ steps.meta-tools.outputs.tags }} push: true