From fbb0f3dde8ed5337cb537501fbeaad384566212d Mon Sep 17 00:00:00 2001 From: snider Date: Tue, 7 Oct 2025 01:00:51 +0100 Subject: [PATCH] Add CONAN_USER and CONAN_PASSWORD to build scripts and implement cache upload step --- .github/workflows/build-linux-arm64.yml | 6 ++++-- .github/workflows/build-linux-intel.yml | 8 +++++--- .github/workflows/build-macos-arm64.yml | 6 ++++-- .github/workflows/build-macos-intel.yml | 6 ++++-- .github/workflows/build-windows-intel.yml | 6 ++++-- Makefile | 19 +++++++++++++------ 6 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-linux-arm64.yml b/.github/workflows/build-linux-arm64.yml index 6e15b24d..25420df2 100644 --- a/.github/workflows/build-linux-arm64.yml +++ b/.github/workflows/build-linux-arm64.yml @@ -45,7 +45,9 @@ jobs: - name: Compile Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: | + make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} + make upload-conan-cache build: name: compile-arm64 @@ -76,7 +78,7 @@ jobs: - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" - name: Compile Release - run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts diff --git a/.github/workflows/build-linux-intel.yml b/.github/workflows/build-linux-intel.yml index ba68329a..8385b594 100644 --- a/.github/workflows/build-linux-intel.yml +++ b/.github/workflows/build-linux-intel.yml @@ -45,8 +45,10 @@ jobs: - name: Compile Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} - + run: | + make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} + make upload-conan-cache + build: name: compile-x86_64 @@ -76,7 +78,7 @@ jobs: - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" - name: Compile Release - run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts diff --git a/.github/workflows/build-macos-arm64.yml b/.github/workflows/build-macos-arm64.yml index 8477d630..4b93a4a1 100644 --- a/.github/workflows/build-macos-arm64.yml +++ b/.github/workflows/build-macos-arm64.yml @@ -43,7 +43,9 @@ jobs: - name: Compile Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: make build-deps CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: | + make build-deps CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} + make upload-conan-cache build: name: compile-armv8 @@ -71,7 +73,7 @@ jobs: - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" - name: Compile Release - run: make release CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=3 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts diff --git a/.github/workflows/build-macos-intel.yml b/.github/workflows/build-macos-intel.yml index 697df5fd..39f73ebb 100644 --- a/.github/workflows/build-macos-intel.yml +++ b/.github/workflows/build-macos-intel.yml @@ -41,7 +41,9 @@ jobs: - name: Compile Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: | + make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} + make upload-conan-cache build: name: compile-x86_64 @@ -68,7 +70,7 @@ jobs: - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" - name: Compile Release - run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts diff --git a/.github/workflows/build-windows-intel.yml b/.github/workflows/build-windows-intel.yml index d5bb77f0..2edfae90 100644 --- a/.github/workflows/build-windows-intel.yml +++ b/.github/workflows/build-windows-intel.yml @@ -41,7 +41,9 @@ jobs: - name: Compile Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: | + make build-deps CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} + make upload-conan-cache build: name: compile-x86_64 @@ -68,7 +70,7 @@ jobs: - run: pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin "mkdocs-material[imaging]" - name: Compile Release - run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} + run: make release CPU_CORES=4 TESTNET=${{ inputs.chain-network == 'testnet' && '1' || '0' }} CONAN_USER=ci-user CONAN_PASSWORD=${{ secrets.CONAN_PASSWORD }} - name: CLI Artifacts uses: ./.github/actions/upload-artifacts diff --git a/Makefile b/Makefile index c12611af..5c33ed84 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,9 @@ CONAN_CPU_COUNT=$(CPU_CORES) PROFILES := $(patsubst cmake/profiles/%,%,$(wildcard cmake/profiles/*)) SORTED_PROFILES := $(sort $(PROFILES)) CONAN_CACHE := $(CURDIR)/build/sdk +CONAN_URL:=https://artifacts.host.uk.com/artifactory/api/conan/conan-build +CONAN_USER:=public +CONAN_PASSWORD:=Lethean1234 DEFAULT_CONAN_PROFILE := $(CONAN_CACHE)/profiles/default CONAN_EXECUTABLE := $(CURDIR)/build/bin/conan CC_DOCKER_FILE?=utils/docker/images/lthn-chain/Dockerfile @@ -91,8 +94,17 @@ configure: build-deps @echo "Running Configure: $(BUILD_TYPE) testnet=$(TESTNET)" cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION) +docs: configure + @echo "Building Documentation" + cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES) + get-conan: cmake -P cmake/GetConan.cmake + (CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) remote add conan_build $(CONAN_URL) && \ + CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) remote login conan_build $(CONAN_USER) -p $(CONAN_PASSWORD)) || true + +upload-conan-cache: + CONAN_HOME=$(CONAN_CACHE) $(CONAN_EXECUTABLE) upload "*" -r=conan_build --confirm conan-profile-detect: get-conan cmake -P cmake/ConanProfileSetup.cmake @@ -139,11 +151,6 @@ test-debug: cmake --build build/test-debug --config=Debug --parallel=$(CPU_CORES) $(MAKE) test - -docs: configure - @echo "Building Documentation" - cmake --build build/release --target=docs --config=Release --parallel=$(CPU_CORES) - docs-dev: configure @echo "Building Documentation" cmake --build build/release --target=serve_docs --config=Release @@ -157,4 +164,4 @@ clean-build: tags: ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest -.PHONY: all release docker-chain-node debug docs docs-dev configure static static-release test test-release test-debug clean tags conan-profile-detect get-conan $(PROFILES) +.PHONY: all release upload-conan-cache docker-chain-node debug docs docs-dev configure static static-release test test-release test-debug clean tags conan-profile-detect get-conan $(PROFILES)