From 1861a0132a87c773e98ccf660118af0761abc64f Mon Sep 17 00:00:00 2001 From: Krystie Date: Fri, 17 Apr 2026 02:08:25 -0700 Subject: [PATCH] Fix TRI-PI ARM64 workflow for latest upstream releases --- .github/workflows/README.md | 6 +++-- .github/workflows/build-arm64.yml | 44 ++++++++++++++++++++++++------- README.md | 4 +-- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 5671b05..9d493ba 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -34,9 +34,11 @@ To manually build a specific version: 1. Go to **Actions** tab 2. Select **Build TRI-PI ARM64** workflow 3. Click **Run workflow** -4. Enter version tag (e.g., `v5.4.5`) +4. Optionally enter a version tag (for example `v5.8.1`) 5. Click **Run workflow** +If no version is supplied, the workflow builds the latest published `triangles_v5` release. + ### Automatic Updates The workflow runs every 6 hours to check for new releases. When detected: @@ -48,4 +50,4 @@ No manual intervention needed! ### Version Tracking -Current version stored in `VERSION` file at repo root. +Current version is stored in `VERSION` at repo root and updated by the ARM64 build workflow to match the upstream `triangles_v5` tag it actually built. diff --git a/.github/workflows/build-arm64.yml b/.github/workflows/build-arm64.yml index c7d7a52..0c7da48 100644 --- a/.github/workflows/build-arm64.yml +++ b/.github/workflows/build-arm64.yml @@ -1,31 +1,50 @@ name: Build TRI-PI ARM64 on: - # Triggered when triangles_v5 has a new release repository_dispatch: types: [new-release] - - # Manual trigger (always builds latest) workflow_dispatch: + inputs: + version: + description: "triangles_v5 tag to build (example: v5.8.1). Leave empty to use latest upstream release." + required: false + type: string permissions: contents: write jobs: build-arm64: - # Use GitHub Actions QEMU for ARM64 emulation runs-on: ubuntu-latest steps: - name: Checkout tri-pi repo uses: actions/checkout@v4 - - name: Get latest triangles version + - name: Resolve target triangles version id: get-version + shell: bash run: | - # Always fetch latest from triangles_v5 repo - VERSION=$(curl -s https://api.github.com/repos/SamiAhmed7777/triangles_v5/releases/latest | grep '"tag_name"' | cut -d'"' -f4) - echo "version=$VERSION" >> $GITHUB_OUTPUT + set -euo pipefail + + VERSION="" + + if [ "${{ github.event_name }}" = "repository_dispatch" ]; then + VERSION="${{ github.event.client_payload.version }}" + elif [ -n "${{ github.event.inputs.version || '' }}" ]; then + VERSION="${{ github.event.inputs.version }}" + fi + + if [ -z "$VERSION" ]; then + VERSION=$(curl -fsSL https://api.github.com/repos/SamiAhmed7777/triangles_v5/releases/latest | jq -r .tag_name) + fi + + if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then + echo "Failed to resolve triangles_v5 release version" >&2 + exit 1 + fi + + echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "🔍 Building triangles $VERSION for ARM64" - name: Set up QEMU @@ -55,7 +74,7 @@ jobs: apt-get install -y -qq \ 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 + libminiupnpc-dev libzmq3-dev tor curl wget ca-certificates jq # Build BerkeleyDB 4.8 cd /tmp @@ -107,6 +126,11 @@ jobs: echo "📦 Package created:" ls -lh "${PACKAGE_DIR}.tar.gz"* + - name: Update repo version markers + run: | + VERSION="${{ steps.get-version.outputs.version }}" + printf '%s\n' "$VERSION" > VERSION + - name: Commit and push changes run: | VERSION="${{ steps.get-version.outputs.version }}" @@ -114,7 +138,7 @@ jobs: git config user.name "TRI-PI Builder" git config user.email "bot@tri-pi.build" - git add bin/trianglesd VERSION releases/ + git add VERSION bin/trianglesd releases/ git commit -m "Auto-build: TRI-PI ${VERSION} ARM64 release - Native ARM64 binary, GitHub Actions QEMU" || echo "No changes to commit" git push origin main || echo "Already up to date" diff --git a/README.md b/README.md index 1a7e01e..a56c0f9 100644 --- a/README.md +++ b/README.md @@ -113,9 +113,9 @@ trianglesd manages Tor automatically: ## Automated Builds -New releases are built automatically via GitHub Actions when upstream triangles_v5 publishes a release. The CI uses QEMU ARM64 emulation on GitHub-hosted runners. +New releases are built automatically via GitHub Actions when upstream `triangles_v5` publishes a release. The CI uses QEMU ARM64 emulation on GitHub-hosted runners. -**Manual trigger:** [Actions](https://github.com/SamiAhmed7777/tri-pi/actions) → "Build TRI-PI ARM64" → "Run workflow" +**Manual trigger:** [Actions](https://github.com/SamiAhmed7777/tri-pi/actions) → "Build TRI-PI ARM64" → "Run workflow". You can leave the version blank to build the latest upstream release, or provide a specific upstream tag such as `v5.8.1`. ## Network