Skip to content

Add safety check for empty remainingOutputs in mint loop #2552

Add safety check for empty remainingOutputs in mint loop

Add safety check for empty remainingOutputs in mint loop #2552

Workflow file for this run

name: Continuous Integration on Master
on:
push:
paths-ignore:
- 'doc/**'
- '**/README.md'
branches:
- '**'
pull_request:
paths-ignore:
- 'doc/**'
- '**/README.md'
branches:
- master
env:
SOURCE_ARTIFACT: source
SOURCE_ARTIFACT_DIR: source
CACHE_MAX_SIZE: 5G
jobs:
get-commit-hash:
name: Get Commit Hash String
runs-on: ubuntu-latest
outputs:
short_sha: ${{ steps.short-sha.outputs.sha }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }} # Use PR head commit
fetch-depth: 1
- id: short-sha
run: |
set -exo pipefail
# For PRs, use pull_request.head.sha, otherwise use the normal HEAD
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)
else
SHA=$(git rev-parse --short=7 HEAD)
fi
echo "sha=$SHA" >> $GITHUB_OUTPUT
echo "Short hash determined: $SHA"
build-linux-cmake:
needs: get-commit-hash
name: build-linux-cmake
runs-on: ubuntu-22.04
env:
ARTIFACT_DIR: linux-cmake-binaries
TEST_LOG_ARTIFACT_DIR: test-logs
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Checkout
uses: actions/checkout@v4
- name: Install Required Packages
run: |
set -exo pipefail
sudo apt-get update
sudo apt-get install -y python3-zmq cmake build-essential ninja-build ccache
- name: Setup ccache
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-linux-${{ github.sha }}
restore-keys: |
ccache-linux-
- name: Configure ccache
run: |
set -exo pipefail
ccache --set-config=max_size=${{ env.CACHE_MAX_SIZE }}
ccache --set-config=compression=true
echo "/usr/lib/ccache" >> $GITHUB_PATH
- name: Verify ZMQ Installation
run: |
set -exo pipefail
python3 -m pip install --upgrade pip
python3 -m pip install pyzmq
- name: Set HOST_TRIPLET for cache key
id: depends-host-triplet
run: |
set -exo pipefail
echo "value=$(depends/config.guess)" >> $GITHUB_OUTPUT
- name: Cache Dependencies
uses: actions/cache@v5
id: cache-depends-linux
with:
path: |
depends/built
depends/sources
depends/work
key: depends-linux-${{ steps.depends-host-triplet.outputs.value }}-${{ hashFiles('depends/packages/*.mk', 'depends/patches/**', 'depends/hosts/*.mk', 'depends/builders/*.mk') }}
restore-keys: |
depends-linux-${{ steps.depends-host-triplet.outputs.value }}-
depends-linux-
- name: Download Dependencies
if: steps.cache-depends-linux.outputs.cache-hit != 'true'
run: |
set -exo pipefail
attempt=1
max=5
until make -C depends download; do
if [ "$attempt" -ge "$max" ]; then
echo "make -C depends download failed after $attempt attempts"
exit 1
fi
echo "make -C depends download attempt $attempt failed; retrying in $((attempt*5))s..."
sleep $((attempt*5))
attempt=$((attempt+1))
done
- name: Build Dependencies
run: |
set -exo pipefail
make -C depends -j$(nproc)
- name: Build Firo
run: |
set -exo pipefail
export HOST_TRIPLET=$(depends/config.guess)
env PKG_CONFIG_PATH="$(realpath depends/$HOST_TRIPLET/lib/pkgconfig):$PKG_CONFIG_PATH" \
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$(realpath depends/$HOST_TRIPLET/toolchain.cmake) \
-DBUILD_CLI=ON -DBUILD_TESTS=ON -DENABLE_CRASH_HOOKS=ON -DBUILD_GUI=ON -DCMAKE_BUILD_TYPE=Release \
-DCLIENT_VERSION_IS_RELEASE=true -S$(realpath .) -B$(realpath build)
cd build && ninja
- name: Run Unit Tests
run: |
set -exo pipefail
cd build && ctest --output-on-failure
- name: Run RPC Tests
env:
TIMEOUT: 600
run: |
set -exo pipefail
cp -rf build/bin/* build/src/
qa/pull-tester/rpc-tests.py -extended
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
mv build/bin/{firo-cli,firo-tx,firod,firo-qt} $ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: linux-cmake-binaries-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}
- name: Prepare Test Logs for Artifact
if: failure()
run: |
set -exo pipefail
tor_log=$(find . -path '*/tor/test-suite.log' -type f 2>/dev/null | head -n1)
firo_log=$(find . -path '*/src/test-suite.log' -type f 2>/dev/null | head -n1)
mkdir -p $TEST_LOG_ARTIFACT_DIR
if [ -n "$tor_log" ] && [ -f "$tor_log" ]; then
mv "$tor_log" "$TEST_LOG_ARTIFACT_DIR/tor.log"
fi
if [ -n "$firo_log" ] && [ -f "$firo_log" ]; then
mv "$firo_log" "$TEST_LOG_ARTIFACT_DIR/firo.log"
fi
- name: Upload Test Logs Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-linux-cmake-logs-${{ env.COMMIT_HASH }}
path: ${{ env.TEST_LOG_ARTIFACT_DIR }}
build-windows-cmake:
needs: get-commit-hash
name: build-windows-cmake
runs-on: ubuntu-latest
env:
ARTIFACT_DIR: windows-cmake-binaries
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Required Packages
run: |
set -exo pipefail
sudo apt-get update
sudo apt-get install -y g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64 cmake mingw-w64-common mingw-w64-i686-dev mingw-w64-x86-64-dev wget unzip ninja-build ccache
- name: Setup ccache
uses: actions/cache@v5
with:
path: ~/.ccache
key: ccache-windows-${{ github.sha }}
restore-keys: |
ccache-windows-
- name: Configure ccache
run: |
set -exo pipefail
ccache --set-config=max_size=${{ env.CACHE_MAX_SIZE }}
ccache --set-config=compression=true
echo "/usr/lib/ccache" >> $GITHUB_PATH
- name: Switch MinGW GCC and G++ to POSIX Threading
run: |
set -exo pipefail
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- name: Set HOST_TRIPLET for cache key
id: depends-host-triplet
run: |
set -exo pipefail
echo "value=$(x86_64-w64-mingw32-gcc -dumpmachine)" >> $GITHUB_OUTPUT
- name: Cache Dependencies
uses: actions/cache@v5
id: cache-depends-windows
with:
path: |
depends/built
depends/sources
depends/work
key: depends-windows-${{ steps.depends-host-triplet.outputs.value }}-${{ hashFiles('depends/packages/*.mk', 'depends/patches/**', 'depends/hosts/*.mk', 'depends/builders/*.mk') }}
restore-keys: |
depends-windows-${{ steps.depends-host-triplet.outputs.value }}-
depends-windows-
- name: Download Dependencies
if: steps.cache-depends-windows.outputs.cache-hit != 'true'
run: |
set -exo pipefail
attempt=1
max=5
until make -C depends download; do
if [ "$attempt" -ge "$max" ]; then
echo "make -C depends download failed after $attempt attempts"
exit 1
fi
echo "make -C depends download attempt $attempt failed; retrying in $((attempt*5))s..."
sleep $((attempt*5))
attempt=$((attempt+1))
done
- name: Fix MinGW headers
shell: bash
run: |
set -euxo pipefail
MINGW_INC="/usr/x86_64-w64-mingw32/include"
D3D12_H="$MINGW_INC/d3d12.h"
# 1. Patch netlistmgr.h (Standard fix)
if ! grep -q "NLM_INTERNET_CONNECTIVITY_WEBHIJACK" "$MINGW_INC/netlistmgr.h"; then
sudo bash -c "cat >> '$MINGW_INC/netlistmgr.h' <<'EOF'
#ifndef NLM_INTERNET_CONNECTIVITY_WEBHIJACK
#define NLM_INTERNET_CONNECTIVITY_WEBHIJACK 0x1
#endif
EOF"
fi
- name: Build Dependencies
run: |
set -exo pipefail
make -C depends -j$(nproc) HOST=x86_64-w64-mingw32
- name: Build Firo
run: |
set -exo pipefail
export HOST_TRIPLET=$(x86_64-w64-mingw32-gcc -dumpmachine)
env PKG_CONFIG_PATH="$(realpath depends/$HOST_TRIPLET/lib/pkgconfig):$PKG_CONFIG_PATH" \
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$(realpath depends/$HOST_TRIPLET/toolchain.cmake) \
-DBUILD_CLI=ON -DBUILD_TESTS=OFF -DENABLE_CRASH_HOOKS=ON -DCMAKE_BUILD_TYPE=Release \
-DCLIENT_VERSION_IS_RELEASE=true -DBUILD_GUI=ON -S$(realpath .) -B$(realpath build)
cd build && ninja
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
mv build/bin/{firo-cli.exe,firo-tx.exe,firod.exe,firo-qt.exe} $ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: windows-cmake-binaries-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}
build-mac-cmake:
needs: get-commit-hash
name: build-mac-cmake
runs-on: macos-latest
env:
ARTIFACT_DIR: mac-cmake-binaries
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Xcode instead of Command Line Tools
run: |
set -exo pipefail
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: Set NJOBS variable
run: |
set -exo pipefail
NCPU=$(sysctl -n hw.ncpu)
JOBS=$((NCPU / 2 > 1 ? NCPU / 2 : 1)) # Use half, but at least 1
echo "NJOBS=$JOBS" >> $GITHUB_ENV # Persist NJOBS across steps
echo "Using $JOBS jobs for parallel builds."
# -j$(sysctl -n hw.activecpu) fails. due to high load on macOS, and crappy github runners.
- name: Install Required Packages
run: |
set -exo pipefail
brew uninstall --force cmake
brew install --force automake coreutils python-setuptools cmake make pkg-config ninja ccache
# Workaround for macOS: https://github.com/actions/runner/issues/2958
- name: Install setuptools
run: |
set -exo pipefail
sudo -H pip install setuptools
- name: Setup ccache
uses: actions/cache@v5
with:
path: ~/Library/Caches/ccache
key: ccache-mac-${{ github.sha }}
restore-keys: |
ccache-mac-
- name: Configure ccache
run: |
set -exo pipefail
ccache --set-config=max_size=${{ env.CACHE_MAX_SIZE }}
ccache --set-config=compression=true
echo "$(brew --prefix ccache)/libexec" >> $GITHUB_PATH
- name: Set HOST_TRIPLET for cache key
id: depends-host-triplet
run: |
set -exo pipefail
echo "value=$(depends/config.guess)" >> $GITHUB_OUTPUT
- name: Cache Dependencies
uses: actions/cache@v5
id: cache-depends-mac
with:
path: |
depends/built
depends/sources
depends/work
key: depends-mac-${{ steps.depends-host-triplet.outputs.value }}-${{ hashFiles('depends/packages/*.mk', 'depends/patches/**', 'depends/hosts/*.mk', 'depends/builders/*.mk') }}
restore-keys: |
depends-mac-${{ steps.depends-host-triplet.outputs.value }}-
depends-mac-
- name: Download Dependencies
if: steps.cache-depends-mac.outputs.cache-hit != 'true'
run: |
set -exo pipefail
attempt=1
max=5
until make -C depends download; do
if [ "$attempt" -ge "$max" ]; then
echo "make -C depends download failed after $attempt attempts"
exit 1
fi
echo "make -C depends download attempt $attempt failed; retrying in $((attempt*5))s..."
sleep $((attempt*5))
attempt=$((attempt+1))
done
- name: Build Dependencies
run: |
set -exo pipefail
make -C depends -j$NJOBS
- name: Build Firo
run: |
set -exo pipefail
export HOST_TRIPLET=$(depends/config.guess)
env PKG_CONFIG_PATH="$(pwd)/depends/$HOST_TRIPLET/lib/pkgconfig:$PKG_CONFIG_PATH" \
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$(pwd)/depends/$HOST_TRIPLET/toolchain.cmake \
-DBUILD_CLI=ON -DBUILD_TESTS=OFF -DENABLE_CRASH_HOOKS=ON -DBUILD_GUI=ON -DCMAKE_BUILD_TYPE=Release \
-DCLIENT_VERSION_IS_RELEASE=true -S$(pwd) -B$(pwd)/build
cd build && ninja
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
mv build/bin/{firo-cli,firo-tx,firod,firo-qt} $ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: mac-cmake-binaries-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}
build-guix-x86_64-linux-gnu:
needs: get-commit-hash
name: build-guix-x86_64-linux-gnu
runs-on: ubuntu-22.04
env:
HOST: x86_64-linux-gnu
ARTIFACT_DIR: guix-binaries-x86_64-linux-gnu
SUBSTITUTE_URLS: "http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0 # Optional: Ensures git describe finds tags correctly
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Free Disk Space
run: |
set -exo pipefail
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /var/tmp/*
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*
sudo rm -rf /var/cache/*
sudo rm -rf /var/log/*
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Disk space now: $(df -h / | tail -1 | awk '{print $4}')"
- name: Setup swap
run: |
set -exo pipefail
# Turn off and remove existing swapfile if present
if [ -f /swapfile ]; then
sudo swapoff /swapfile 2>/dev/null || true
sudo rm -f /swapfile
fi
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "Swap enabled:"
sudo swapon --show
- name: Prepare Guix cache dirs
run: |
set -exo pipefail
sudo mkdir -p /var/guix/cache /var/guix/archives
sudo chown -R $USER:$USER /var/guix/cache /var/guix/archives
mkdir -p ~/.cache/guix ~/.config/guix ~/.local/share/guix
- name: Cache Guix downloads
uses: actions/cache@v5
id: cache-guix-x86_64-linux-gnu
with:
path: |
~/.cache/guix
~/.config/guix
~/.local/share/guix
/var/guix/cache
/var/guix/archives
key: guix-${{ env.HOST }}-${{ hashFiles('contrib/guix/**') }}
restore-keys: |
guix-${{ env.HOST }}-
- name: Install Guix
run: |
set -exo pipefail
sudo apt-get update
sudo apt-get install -y guix
guix pull --url=https://codeberg.org/guix/guix-mirror --substitute-urls="http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
- name: Run Guix Build
run: |
set -exo pipefail
./contrib/guix/guix-clean || true
CORES=$(($(nproc) - 1 > 0 ? $(nproc) - 1 : 1))
env HOSTS="${HOST}" \
ADDITIONAL_GUIX_COMMON_FLAGS="--cores=$CORES --max-jobs=$CORES" ./contrib/guix/guix-build
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
cp -r ./guix-build-*/output/${HOST}/* $ARTIFACT_DIR/ || true
cd $ARTIFACT_DIR
mv *-gnu.tar.gz x86_64-linux-guix-release-binaries.tar.gz || true
mv *-gnu-debug.tar.gz x86_64-linux-guix-debug-symbols.tar.gz || true
mv SHA256SUMS.part x86_64-linux-guix-checksums-sha256 || true
- name: Upload Release Binaries
uses: actions/upload-artifact@v4
with:
name: x86_64-linux-guix-release-binaries-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-linux-guix-release-binaries.tar.gz
compression-level: 0
- name: Upload Debug Binaries
uses: actions/upload-artifact@v4
with:
name: x86_64-linux-guix-debug-binaries-${{ env.COMMIT_HASH }}
path: |
${{ env.ARTIFACT_DIR }}/firo-cli
${{ env.ARTIFACT_DIR }}/firo-qt
${{ env.ARTIFACT_DIR }}/firo-tx
${{ env.ARTIFACT_DIR }}/firod
${{ env.ARTIFACT_DIR }}/README.md
compression-level: 6
- name: Upload Debug Symbols
uses: actions/upload-artifact@v4
with:
name: x86_64-linux-guix-debug-symbols-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-linux-guix-debug-symbols.tar.gz
compression-level: 0
- name: Upload Check Sums
uses: actions/upload-artifact@v4
with:
name: x86_64-linux-guix-checksums-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-linux-guix-checksums-sha256
compression-level: 0
build-guix-aarch64-linux-gnu:
needs: get-commit-hash
name: build-guix-aarch64-linux-gnu
runs-on: ubuntu-22.04
env:
HOST: aarch64-linux-gnu
ARTIFACT_DIR: guix-binaries-aarch64-linux-gnu
SUBSTITUTE_URLS: "http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0 # Optional: Ensures git describe finds tags correctly
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Free Disk Space
run: |
set -exo pipefail
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /var/tmp/*
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*
sudo rm -rf /var/cache/*
sudo rm -rf /var/log/*
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Disk space now: $(df -h / | tail -1 | awk '{print $4}')"
- name: Setup swap
run: |
set -exo pipefail
# Turn off and remove existing swapfile if present
if [ -f /swapfile ]; then
sudo swapoff /swapfile 2>/dev/null || true
sudo rm -f /swapfile
fi
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "Swap enabled:"
sudo swapon --show
- name: Prepare Guix cache dirs
run: |
set -exo pipefail
sudo mkdir -p /var/guix/cache /var/guix/archives
sudo chown -R $USER:$USER /var/guix/cache /var/guix/archives
mkdir -p ~/.cache/guix ~/.config/guix ~/.local/share/guix
- name: Cache Guix downloads
uses: actions/cache@v5
id: cache-guix-aarch64-linux-gnu
with:
path: |
~/.cache/guix
~/.config/guix
~/.local/share/guix
/var/guix/cache
/var/guix/archives
key: guix-${{ env.HOST }}-${{ hashFiles('contrib/guix/**') }}
restore-keys: |
guix-${{ env.HOST }}-
- name: Install Guix
run: |
set -exo pipefail
sudo apt-get update
sudo apt-get install -y guix
guix pull --url=https://codeberg.org/guix/guix-mirror --substitute-urls="http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
- name: Run Guix Build
run: |
set -exo pipefail
./contrib/guix/guix-clean || true
CORES=$(($(nproc) - 1 > 0 ? $(nproc) - 1 : 1))
env HOSTS="${HOST}" \
ADDITIONAL_GUIX_COMMON_FLAGS="--cores=$CORES --max-jobs=$CORES" ./contrib/guix/guix-build
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
cp -r ./guix-build-*/output/${HOST}/* $ARTIFACT_DIR/ || true
cd $ARTIFACT_DIR
mv *-gnu.tar.gz aarch64-linux-guix-release-binaries.tar.gz || true
mv *-gnu-debug.tar.gz aarch64-linux-guix-debug-symbols.tar.gz || true
mv SHA256SUMS.part aarch64-linux-guix-checksums-sha256 || true
- name: Upload Release Binaries
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-guix-release-binaries-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/aarch64-linux-guix-release-binaries.tar.gz
compression-level: 0
- name: Upload Debug Binaries
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-guix-debug-binaries-${{ env.COMMIT_HASH }}
path: |
${{ env.ARTIFACT_DIR }}/firo-cli
${{ env.ARTIFACT_DIR }}/firo-qt
${{ env.ARTIFACT_DIR }}/firo-tx
${{ env.ARTIFACT_DIR }}/firod
${{ env.ARTIFACT_DIR }}/README.md
compression-level: 6
- name: Upload Debug Symbols
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-guix-debug-symbols-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/aarch64-linux-guix-debug-symbols.tar.gz
compression-level: 0
- name: Upload Check Sums
uses: actions/upload-artifact@v4
with:
name: aarch64-linux-guix-checksums-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/aarch64-linux-guix-checksums-sha256
build-guix-x86_64-w64-mingw32:
needs: get-commit-hash
name: build-guix-x86_64-w64-mingw32
runs-on: ubuntu-22.04
env:
HOST: x86_64-w64-mingw32
ARTIFACT_DIR: guix-binaries-x86_64-w64-mingw32
SUBSTITUTE_URLS: "http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0 # Optional: Ensures git describe finds tags correctly
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Free Disk Space
run: |
set -exo pipefail
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /var/tmp/*
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*
sudo rm -rf /var/cache/*
sudo rm -rf /var/log/*
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Disk space now: $(df -h / | tail -1 | awk '{print $4}')"
- name: Setup swap
run: |
set -exo pipefail
# Turn off and remove existing swapfile if present
if [ -f /swapfile ]; then
sudo swapoff /swapfile 2>/dev/null || true
sudo rm -f /swapfile
fi
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "Swap enabled:"
sudo swapon --show
- name: Prepare Guix cache dirs
run: |
set -exo pipefail
sudo mkdir -p /var/guix/cache /var/guix/archives
sudo chown -R $USER:$USER /var/guix/cache /var/guix/archives
mkdir -p ~/.cache/guix ~/.config/guix ~/.local/share/guix
- name: Cache Guix downloads
uses: actions/cache@v5
id: cache-guix-x86_64-w64-mingw32
with:
path: |
~/.cache/guix
~/.config/guix
~/.local/share/guix
/var/guix/cache
/var/guix/archives
key: guix-${{ env.HOST }}-${{ hashFiles('contrib/guix/**') }}
restore-keys: |
guix-${{ env.HOST }}-
- name: Install Guix
run: |
set -exo pipefail
sudo apt-get update
sudo apt-get install -y guix g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64
guix pull --url=https://codeberg.org/guix/guix-mirror --substitute-urls="http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
- name: Run Guix Build
run: |
set -exo pipefail
./contrib/guix/guix-clean || true
CORES=$(($(nproc) - 1 > 0 ? $(nproc) - 1 : 1))
env HOSTS="${HOST}" \
ADDITIONAL_GUIX_COMMON_FLAGS="--cores=$CORES --max-jobs=$CORES" ./contrib/guix/guix-build
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
cp -r ./guix-build-*/output/${HOST}/* $ARTIFACT_DIR/ || true
cd $ARTIFACT_DIR
mv *-win-unsigned.tar.gz x86_64-win64-guix-setup-sign-bundle.tar.gz || true
mv *-win64-debug.zip x86_64-win64-guix-debug-symbols.zip || true
mv *-win64-setup-unsigned.exe x86_64-win64-guix-installer-unsigned.exe || true
mv *-win64.zip x86_64-win64-guix-release-binaries.zip || true
mv SHA256SUMS.part x86_64-wind64-guix-checksums-sha256 || true
- name: Upload Windows Release Binaries
uses: actions/upload-artifact@v4
with:
name: x86_64-win64-guix-release-binaries-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-win64-guix-release-binaries.zip
compression-level: 0
- name: Upload Windows Debug Symbols
uses: actions/upload-artifact@v4
with:
name: x86_64-win64-guix-debug-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-win64-guix-debug-symbols.zip
compression-level: 0
- name: Upload Windows Installer (Unsigned)
uses: actions/upload-artifact@v4
with:
name: x86_64-win64-guix-installer-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-win64-guix-installer-unsigned.exe
compression-level: 0
- name: Upload Windows Setup Sign Bundle
uses: actions/upload-artifact@v4
with:
name: x86_64-win64-guix-setup-sign-bundle-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-win64-guix-setup-sign-bundle.tar.gz
compression-level: 0
- name: Upload Windows Checksums
uses: actions/upload-artifact@v4
with:
name: x86_64-win64-guix-checksums-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-win64-guix-checksums-sha256
compression-level: 0
build-guix-arm64-apple-darwin:
needs: get-commit-hash
name: build-guix-arm64-apple-darwin
runs-on: ubuntu-22.04
env:
HOST: arm64-apple-darwin
ARTIFACT_DIR: guix-binaries-arm64-apple-darwin
SUBSTITUTE_URLS: "http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0 # Optional: Ensures git describe finds tags correctly
- name: Install Guix
run: |
set -exo pipefail
sudo apt-get update
sudo apt-get install -y guix
guix pull --url=https://codeberg.org/guix/guix-mirror --substitute-urls="http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
- name: Clean Guix build dirs
run: |
set -exo pipefail
./contrib/guix/guix-clean || true
- name: Download macOS SDK
run: |
set -exo pipefail
wget https://bitcoincore.org/depends-sources/sdks/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
- name: Verify macOS SDK SHA256
run: |
set -exo pipefail
echo "c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz" | sha256sum -c -
- name: Extract macOS SDK
run: |
set -exo pipefail
mkdir -p depends/SDKs
tar -xf Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz -C depends/SDKs/
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Free Disk Space
run: |
set -exo pipefail
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /var/tmp/*
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*
sudo rm -rf /var/cache/*
sudo rm -rf /var/log/*
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Disk space now: $(df -h / | tail -1 | awk '{print $4}')"
- name: Setup swap
run: |
set -exo pipefail
# Turn off and remove existing swapfile if present
if [ -f /swapfile ]; then
sudo swapoff /swapfile 2>/dev/null || true
sudo rm -f /swapfile
fi
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "Swap enabled:"
sudo swapon --show
- name: Prepare Guix cache dirs
run: |
set -exo pipefail
sudo mkdir -p /var/guix/cache /var/guix/archives
sudo chown -R $USER:$USER /var/guix/cache /var/guix/archives
mkdir -p ~/.cache/guix ~/.config/guix ~/.local/share/guix
- name: Cache Guix downloads
uses: actions/cache@v5
id: cache-guix-arm64-apple-darwin
with:
path: |
~/.cache/guix
~/.config/guix
~/.local/share/guix
/var/guix/cache
/var/guix/archives
key: guix-${{ env.HOST }}-${{ hashFiles('contrib/guix/**') }}
restore-keys: |
guix-${{ env.HOST }}-
- name: Download Dependencies
run: |
set -exo pipefail
attempt=1
max=5
until make -C depends download; do
if [ "$attempt" -ge "$max" ]; then
echo "make -C depends download failed after $attempt attempts"
exit 1
fi
echo "make -C depends download attempt $attempt failed; retrying in $((attempt*5))s..."
sleep $((attempt*5))
attempt=$((attempt+1))
done
- name: Clean Guix build dirs for retry
run: |
set -exo pipefail
rm -rf guix-build-*/distsrc-*-"${HOST}"
rm -rf guix-build-*/build-*-"${HOST}"
- name: Run Guix Build
run: |
set -exo pipefail
CORES=$(($(nproc) - 1 > 0 ? $(nproc) - 1 : 1))
export SDK_PATH="$(pwd)/depends/SDKs"
env HOSTS="${HOST}" \
SDK_PATH="$SDK_PATH" \
ADDITIONAL_GUIX_COMMON_FLAGS="--cores=$CORES --max-jobs=$CORES" ./contrib/guix/guix-build
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
cp -r ./guix-build-*/output/${HOST}/* $ARTIFACT_DIR/ || true
cd $ARTIFACT_DIR
mv *-osx-unsigned.tar.gz arm64-apple-darwin-sign-bundle.tar.gz || true
mv Firo-Core.tar.gz arm64-apple-darwin-app-image.tar.gz || true
mv SHA256SUMS.part arm64-apple-darwin-checksums-sha256 || true
tar xf firo*arm64-apple-darwin.tar.gz --strip-components=1 || true
mv share/man . || true
- name: Upload MacOS Release Binaries
uses: actions/upload-artifact@v4
with:
name: arm64-apple-darwin-release-binaries-${{ env.COMMIT_HASH }}
path: |
${{ env.ARTIFACT_DIR }}/firo-cli
${{ env.ARTIFACT_DIR }}/firo-qt
${{ env.ARTIFACT_DIR }}/firo-tx
${{ env.ARTIFACT_DIR }}/firod
${{ env.ARTIFACT_DIR }}/README.md
${{ env.ARTIFACT_DIR }}/man
compression-level: 6
- name: Upload MacOS Sign Bundle
uses: actions/upload-artifact@v4
with:
name: arm64-apple-darwin-sign-bundle-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/arm64-apple-darwin-sign-bundle.tar.gz
compression-level: 0
- name: Upload MacOS App Image
uses: actions/upload-artifact@v4
with:
name: arm64-apple-darwin-app-image-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/arm64-apple-darwin-app-image.tar.gz
compression-level: 0
- name: Upload Check Sums
uses: actions/upload-artifact@v4
with:
name: arm64-apple-darwin-checksums-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/arm64-apple-darwin-checksums-sha256
build-guix-x86_64-apple-darwin:
needs: get-commit-hash
name: build-guix-x86_64-apple-darwin
runs-on: ubuntu-22.04
env:
HOST: x86_64-apple-darwin
ARTIFACT_DIR: guix-binaries-x86_64-apple-darwin
SUBSTITUTE_URLS: "http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
COMMIT_HASH: ${{ needs.get-commit-hash.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0 # Optional: Ensures git describe finds tags correctly
- name: Install Guix
run: |
set -exo pipefail
sudo apt-get update
sudo apt-get install -y guix
guix pull --url=https://codeberg.org/guix/guix-mirror --substitute-urls="http://git.savannah.gnu.org/git/guix.git http://hydra-guix-129.guix.gnu.org http://ci.guix.gnu.org"
- name: Clean Guix build dirs
run: |
set -exo pipefail
./contrib/guix/guix-clean || true
- name: Download macOS SDK
run: |
set -exo pipefail
wget https://bitcoincore.org/depends-sources/sdks/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
- name: Verify macOS SDK SHA256
run: |
set -exo pipefail
echo "c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz" | sha256sum -c -
- name: Extract macOS SDK
run: |
set -exo pipefail
mkdir -p depends/SDKs
tar -xf Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz -C depends/SDKs/
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Free Disk Space
run: |
set -exo pipefail
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
sudo rm -rf /var/tmp/*
sudo rm -rf /tmp/*
sudo rm -rf /var/tmp/*
sudo rm -rf /var/cache/*
sudo rm -rf /var/log/*
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
echo "Disk space now: $(df -h / | tail -1 | awk '{print $4}')"
- name: Setup swap
run: |
set -exo pipefail
# Turn off and remove existing swapfile if present
if [ -f /swapfile ]; then
sudo swapoff /swapfile 2>/dev/null || true
sudo rm -f /swapfile
fi
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "Swap enabled:"
sudo swapon --show
- name: Prepare Guix cache dirs
run: |
set -exo pipefail
sudo mkdir -p /var/guix/cache /var/guix/archives
sudo chown -R $USER:$USER /var/guix/cache /var/guix/archives
mkdir -p ~/.cache/guix ~/.config/guix ~/.local/share/guix
- name: Cache Guix downloads
uses: actions/cache@v5
id: cache-guix-x86_64-apple-darwin
with:
path: |
~/.cache/guix
~/.config/guix
~/.local/share/guix
/var/guix/cache
/var/guix/archives
key: guix-${{ env.HOST }}-${{ hashFiles('contrib/guix/**') }}
restore-keys: |
guix-${{ env.HOST }}-
- name: Download Dependencies
run: |
set -exo pipefail
attempt=1
max=5
until make -C depends download; do
if [ "$attempt" -ge "$max" ]; then
echo "make -C depends download failed after $attempt attempts"
exit 1
fi
echo "make -C depends download attempt $attempt failed; retrying in $((attempt*5))s..."
sleep $((attempt*5))
attempt=$((attempt+1))
done
- name: Clean Guix build dirs for retry
run: |
set -exo pipefail
rm -rf guix-build-*/distsrc-*-"${HOST}"
rm -rf guix-build-*/build-*-"${HOST}"
- name: Run Guix Build
run: |
set -exo pipefail
CORES=$(($(nproc) - 1 > 0 ? $(nproc) - 1 : 1))
export SDK_PATH="$(pwd)/depends/SDKs"
env HOSTS="${HOST}" \
SDK_PATH="$SDK_PATH" \
ADDITIONAL_GUIX_COMMON_FLAGS="--cores=$CORES --max-jobs=$CORES" ./contrib/guix/guix-build
- name: Prepare Files for Artifact
run: |
set -exo pipefail
mkdir -p $ARTIFACT_DIR
cp -r ./guix-build-*/output/${HOST}/* $ARTIFACT_DIR/ || true
cd $ARTIFACT_DIR
mv *-osx-unsigned.tar.gz x86_64-apple-darwin-sign-bundle.tar.gz || true
mv Firo-Core.tar.gz x86_64-apple-darwin-app-image.tar.gz || true
mv SHA256SUMS.part x86_64-apple-darwin-checksums-sha256 || true
tar xf firo*x86_64-apple-darwin.tar.gz --strip-components=1 || true
mv share/man . || true
- name: Upload MacOS Release Binaries
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin-release-binaries-${{ env.COMMIT_HASH }}
path: |
${{ env.ARTIFACT_DIR }}/firo-cli
${{ env.ARTIFACT_DIR }}/firo-qt
${{ env.ARTIFACT_DIR }}/firo-tx
${{ env.ARTIFACT_DIR }}/firod
${{ env.ARTIFACT_DIR }}/README.md
${{ env.ARTIFACT_DIR }}/man
compression-level: 6
- name: Upload MacOS Sign Bundle
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin-sign-bundle-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-apple-darwin-sign-bundle.tar.gz
compression-level: 0
- name: Upload MacOS App Image
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin-app-image-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-apple-darwin-app-image.tar.gz
compression-level: 0
- name: Upload Check Sums
uses: actions/upload-artifact@v4
with:
name: x86_64-apple-darwin-checksums-${{ env.COMMIT_HASH }}
path: ${{ env.ARTIFACT_DIR }}/x86_64-apple-darwin-checksums-sha256