1
0
Fork 0
forked from lthn/blockchain

Update Docker build workflow and CPack config

Refactored the Docker build workflow to use a single job with multi-platform support and removed the manifest creation step. Cleaned up the macOS build workflow by removing unnecessary Homebrew installs. Updated CPackConfig.cmake to set the install prefix by default and fixed the documentation install destination to use PROJECT_NAME.
This commit is contained in:
Snider 2025-10-01 21:55:16 +01:00
parent 235b0cb41b
commit 87605db373
3 changed files with 20 additions and 76 deletions

View file

@ -15,99 +15,44 @@ 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-arm
steps:
- uses: actions/checkout@v4
- name: Checkout Project
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- 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
with:
context: ${{ github.workspace }}
file: utils/docker/images/lthn-chain/Dockerfile
context: ${{ github.workspace }}
push: true
platforms: linux/amd64,linux/arm64
build-args: |
BUILD_TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }}
THREADS=2
BUILD_TARGET=gcc-linux-x86_64
BUILD_LOCAL=1
platforms: ${{ matrix.platform }}
tags: lthn/chain:${{ env.LTHN_TAG }}${{ matrix.tag }}
tags: lthn/chain:${{ inputs.chain-network == 'testnet' && 'testnet' || 'latest' }}
cache-from: type=gha
cache-to: type=gha,mode=max
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

@ -33,7 +33,6 @@ jobs:
with:
python-version: 3.x
- run: brew install cairo freetype libffi libjpeg libpng zlib pngquant
- run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]"
- name: Install Conan

View file

@ -8,10 +8,10 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_PACKAGE_CONTACT "${package_contact}")
set(CPACK_PACKAGE_HOMEPAGE_URL "${package_website}")
# set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") # Linux/macOS default
# if(WIN32)
# set(CPACK_PACKAGING_INSTALL_PREFIX "C:/Program Files/${PROJECT_NAME}")
# endif()
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") # Linux/macOS default
if(WIN32)
set(CPACK_PACKAGING_INSTALL_PREFIX "C:/Program Files/${PROJECT_NAME}")
endif()
if(APPLE)
if("${package_macos_installer}" STREQUAL "DMG")
@ -59,7 +59,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/packages")
install(FILES README.md LICENSE.txt
DESTINATION "share/doc/${CPACK_PACKAGE_NAME}"
DESTINATION "share/doc/${PROJECT_NAME}"
)
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")