1
0
Fork 0
forked from lthn/blockchain

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.
This commit is contained in:
Snider 2025-10-02 00:27:45 +01:00
parent 973baa12c0
commit e83edb7661
3 changed files with 11 additions and 82 deletions

View file

@ -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' }}
#

View file

@ -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

View file

@ -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