From e83edb76613c6bfe97a69b6148d00b4729219ca4 Mon Sep 17 00:00:00 2001 From: Snider Date: Thu, 2 Oct 2025 00:27:45 +0100 Subject: [PATCH] Refactor Docker build workflow and update build configs Simplifies the GitHub Actions Docker build workflow by removing matrix builds and standardizing steps. Updates the MSVC CMake profile to use C++14 instead of C++17. Removes an unused make configure step from the Dockerfile. --- .github/workflows/build-docker.yml | 85 +++-------------------- cmake/profiles/msvc-194-x86_64 | 5 +- utils/docker/images/lthn-chain/Dockerfile | 3 - 3 files changed, 11 insertions(+), 82 deletions(-) diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index da98a227..1c235a82 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -15,25 +15,13 @@ on: required: false type: string -env: - LTHN_TAG: ${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }} - jobs: build: - runs-on: ${{ matrix.runner }} - strategy: - matrix: - include: - - arch: amd64 - runner: ubuntu-latest - tag: "-amd64" - platform: linux/amd64 - - arch: arm64 - runner: ubuntu-24.04-arm - tag: "-arm64" - platform: linux/arm64 + name: "lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}" + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - name: Checkout Project + uses: actions/checkout@v4.2.2 with: fetch-depth: 0 submodules: recursive @@ -41,76 +29,23 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Log in to DockerHub + - name: Login to DockerHub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push image + + - name: Build and push + id: docker_build uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_SUMMARY: false with: - context: ${{ github.workspace }} file: utils/docker/images/lthn-chain/Dockerfile + context: ${{ github.workspace }} push: true - target: chain-service build-args: | BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} THREADS=2 BUILD_LOCAL=1 - platforms: ${{ matrix.platform }} - tags: lthn/chain:${{ env.LTHN_TAG }}${{ matrix.tag }} - cache-from: type=gha - cache-to: type=gha,mode=max + tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }} -# manifest: -# needs: build -# runs-on: ubuntu-latest -# steps: -# - name: Log in to DockerHub -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - name: Create and push manifest -# run: | -# docker manifest create lthn/chain:${{ env.LTHN_TAG }} \ -# lthn/chain:${{ env.LTHN_TAG }}-amd64 \ -# lthn/chain:${{ env.LTHN_TAG }}-arm64 -# docker manifest push lthn/chain:${{ env.LTHN_TAG }} -# build: -# name: "lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}" -# runs-on: ubuntu-24.04 -# steps: -# - name: Checkout Project -# uses: actions/checkout@v4.2.2 -# with: -# fetch-depth: 0 -# submodules: recursive -# -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# -# - name: Login to DockerHub -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# -# - name: Build and push -# id: docker_build -# uses: docker/build-push-action@v6 -# with: -# file: utils/docker/images/lthn-chain/Dockerfile -# context: ${{ github.workspace }} -# push: true -# build-args: | -# BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} -# THREADS=2 -# BUILD_LOCAL=1 -# tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }} -# diff --git a/cmake/profiles/msvc-194-x86_64 b/cmake/profiles/msvc-194-x86_64 index aea65d04..64acd970 100644 --- a/cmake/profiles/msvc-194-x86_64 +++ b/cmake/profiles/msvc-194-x86_64 @@ -1,10 +1,7 @@ [settings] arch=x86_64 compiler=msvc -compiler.cppstd=17 +compiler.cppstd=14 compiler.runtime=static compiler.version=194 os=Windows - -[conf] -tools.cmake.cmaketoolchain:user_presets=False diff --git a/utils/docker/images/lthn-chain/Dockerfile b/utils/docker/images/lthn-chain/Dockerfile index cc6820a1..27d92c7d 100644 --- a/utils/docker/images/lthn-chain/Dockerfile +++ b/utils/docker/images/lthn-chain/Dockerfile @@ -32,9 +32,6 @@ RUN if [ "$BUILD_LOCAL" = "0" ]; then \ WORKDIR /code -RUN make configure CPU_CORES=${BUILD_THREADS} TESTNET=${BUILD_TESTNET} STATIC=${BUILD_STATIC} - - FROM builder AS build ARG BUILD_THREADS=1 ARG BUILD_BRANCH=dev