Skip to content

add -generate-vanity-address feature #100

add -generate-vanity-address feature

add -generate-vanity-address feature #100

name: Multi-Platform Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
EXECUTABLE_NAME: "qubic-cli"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Release]
cpp_compiler: [g++, clang++, cl]
include:
- os: windows-latest
cpp_compiler: cl
- os: ubuntu-latest
cpp_compiler: g++
- os: ubuntu-latest
cpp_compiler: clang++
exclude:
- os: windows-latest
cpp_compiler: g++
- os: windows-latest
cpp_compiler: clang++
- os: ubuntu-latest
cpp_compiler: cl
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
# Locate the binary dynamically based on OS
- name: Locate Binary
id: locate-binary
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
# Windows MSVC puts the binary in a Release subfolder
echo "binary_path=${{ steps.strings.outputs.build-output-dir }}/Release/${{ env.EXECUTABLE_NAME }}.exe" >> $GITHUB_OUTPUT
else
# Linux puts it in the build root
echo "binary_path=${{ steps.strings.outputs.build-output-dir }}/${{ env.EXECUTABLE_NAME }}" >> $GITHUB_OUTPUT
fi
# Upload the binary found in the previous step
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
# Give the artifact a unique name based on the matrix settings
name: ${{ env.EXECUTABLE_NAME }}-${{ matrix.os }}-${{ matrix.cpp_compiler }}
path: ${{ steps.locate-binary.outputs.binary_path }}
if-no-files-found: error