Add automated ARM64 builds via GitHub Actions
- Auto-builds on new triangles_v5 releases - Manual trigger with version input - Creates GitHub releases with pre-built binaries - Uses ARM64 Docker container for native builds - Includes BerkeleyDB 4.8 compilation - Generates release notes automatically
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
name: Build TRI-PI ARM64
|
||||
|
||||
on:
|
||||
# Trigger on new tags in upstream triangles_v5 repo
|
||||
repository_dispatch:
|
||||
types: [new-release]
|
||||
|
||||
# Manual trigger
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Triangles version to build (e.g. v5.4.5)'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-arm64:
|
||||
name: Build ARM64 Package
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout TRI-PI repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU for ARM64 emulation
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: linux/arm64
|
||||
|
||||
- name: Build in ARM64 container
|
||||
run: |
|
||||
docker run --rm --platform linux/arm64 \
|
||||
-v $PWD:/workspace \
|
||||
-w /workspace \
|
||||
ubuntu:24.04 bash -c '
|
||||
set -e
|
||||
|
||||
# Install dependencies
|
||||
apt-get update
|
||||
apt-get install -y git build-essential libtool autotools-dev automake \
|
||||
pkg-config libssl-dev libevent-dev bsdmainutils libboost-all-dev \
|
||||
libminiupnpc-dev libzmq3-dev tor curl wget ca-certificates
|
||||
|
||||
# Determine version
|
||||
VERSION="${{ github.event.inputs.version || 'v5.4.4' }}"
|
||||
echo "Building Triangles $VERSION for ARM64"
|
||||
|
||||
# Build BerkeleyDB 4.8
|
||||
echo "=== Building BerkeleyDB 4.8 ==="
|
||||
cd /tmp
|
||||
wget -q http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
|
||||
tar xzf db-4.8.30.NC.tar.gz
|
||||
cd db-4.8.30.NC/build_unix
|
||||
|
||||
# Update config for ARM64
|
||||
wget -q -O ../dist/config.guess \
|
||||
"http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
|
||||
wget -q -O ../dist/config.sub \
|
||||
"http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
|
||||
chmod +x ../dist/config.guess ../dist/config.sub
|
||||
|
||||
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/usr/local
|
||||
make -j$(nproc) > /dev/null 2>&1
|
||||
make install
|
||||
ldconfig
|
||||
|
||||
# Clone and build trianglesd
|
||||
echo "=== Building trianglesd $VERSION ==="
|
||||
cd /tmp
|
||||
git clone https://github.com/SamiAhmed7777/triangles_v5.git
|
||||
cd triangles_v5
|
||||
git checkout $VERSION || git checkout main
|
||||
|
||||
cd src
|
||||
make -f makefile.unix -j$(nproc) USE_UPNP=1
|
||||
|
||||
# Package for release
|
||||
echo "=== Creating release package ==="
|
||||
cd /workspace
|
||||
mkdir -p bin
|
||||
strip /tmp/triangles_v5/src/trianglesd
|
||||
cp /tmp/triangles_v5/src/trianglesd bin/
|
||||
|
||||
# Update version in README
|
||||
CLEAN_VERSION=$(echo $VERSION | sed "s/^v//")
|
||||
sed -i "s/v5\.4\.4/$VERSION/g" README.md
|
||||
sed -i "s/tri-pi-v.*-arm64/tri-pi-$VERSION-arm64/g" README.md
|
||||
|
||||
# Create release tarball
|
||||
cd /workspace/..
|
||||
tar czf tri-pi-$VERSION-arm64.tar.gz \
|
||||
tri-pi/bin/trianglesd \
|
||||
tri-pi/docs/ \
|
||||
tri-pi/install.sh \
|
||||
tri-pi/README.md
|
||||
|
||||
mv tri-pi-$VERSION-arm64.tar.gz /workspace/releases/
|
||||
|
||||
echo "✅ Build complete: tri-pi-$VERSION-arm64.tar.gz"
|
||||
'
|
||||
|
||||
- name: Generate release notes
|
||||
id: release_notes
|
||||
run: |
|
||||
VERSION="${{ github.event.inputs.version || 'v5.4.4' }}"
|
||||
|
||||
cat > release-notes.md << EOF
|
||||
# TRI-PI $VERSION ARM64 Release
|
||||
|
||||
**Built:** $(date -u +"%Y-%m-%d %H:%M UTC")
|
||||
**Platform:** ARM64 (Raspberry Pi 4/5, ARM servers)
|
||||
**Base:** Ubuntu 24.04 ARM64
|
||||
|
||||
## What's Included
|
||||
|
||||
- Native ARM64 \`trianglesd\` binary ($VERSION)
|
||||
- Tor integration (embedded management)
|
||||
- Updated onion seed nodes
|
||||
- One-command installer
|
||||
- Complete documentation
|
||||
|
||||
## Installation
|
||||
|
||||
\`\`\`bash
|
||||
wget https://github.com/SamiAhmed7777/tri-pi/releases/download/$VERSION/tri-pi-$VERSION-arm64.tar.gz
|
||||
tar xzf tri-pi-$VERSION-arm64.tar.gz
|
||||
cd tri-pi-$VERSION-arm64
|
||||
sudo ./install.sh
|
||||
\`\`\`
|
||||
|
||||
## Usage
|
||||
|
||||
\`\`\`bash
|
||||
trianglesd # Start daemon
|
||||
trianglesd getinfo # Check status
|
||||
trianglesd help # List commands
|
||||
\`\`\`
|
||||
|
||||
---
|
||||
|
||||
**Auto-built by GitHub Actions**
|
||||
EOF
|
||||
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ${{ steps.release_notes.outputs.version }}
|
||||
name: TRI-PI ${{ steps.release_notes.outputs.version }} ARM64
|
||||
body_path: release-notes.md
|
||||
files: |
|
||||
releases/tri-pi-${{ steps.release_notes.outputs.version }}-arm64.tar.gz
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Update latest release link
|
||||
run: |
|
||||
VERSION="${{ steps.release_notes.outputs.version }}"
|
||||
|
||||
# Update README with latest release badge
|
||||
sed -i "1i " README.md
|
||||
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git add README.md
|
||||
git commit -m "Update to $VERSION [skip ci]" || true
|
||||
git push || true
|
||||
Reference in New Issue
Block a user