@@ -0,0 +1,98 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Build & Publish Release
|
||||
runs-on: ssh
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check toolchain versions
|
||||
run: node --version && npm --version
|
||||
|
||||
- name: Install root dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Install native-host dependencies
|
||||
run: npm install
|
||||
working-directory: native-host
|
||||
|
||||
- name: Build (host launcher, protomux, hrpc)
|
||||
run: npm run build
|
||||
|
||||
- name: Build all platform binaries
|
||||
run: node scripts/build-distributable.js --all --package
|
||||
|
||||
- name: Package extension (zip + xpi)
|
||||
run: npm run pack
|
||||
|
||||
- name: Smoke test — run binary for current platform
|
||||
run: |
|
||||
echo "=== releases/ layout ==="
|
||||
find releases/ -type f | sort
|
||||
echo ""
|
||||
|
||||
MACHINE=$(uname -m)
|
||||
echo "uname -m: $MACHINE"
|
||||
|
||||
BIN=""
|
||||
for candidate in \
|
||||
"releases/${MACHINE}/bridge-swarm-host" \
|
||||
"releases/x86_64/bridge-swarm-host" \
|
||||
"releases/aarch64/bridge-swarm-host" \
|
||||
"releases/arm64/bridge-swarm-host" \
|
||||
"releases/bridge-swarm-host"; do
|
||||
if [ -f "$candidate" ]; then
|
||||
BIN="$candidate"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$BIN" ]; then
|
||||
echo "No runnable binary found — skipping smoke test"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Testing binary: $BIN"
|
||||
chmod +x "$BIN"
|
||||
OUTPUT=$(timeout 6 "$BIN" </dev/null 2>&1 || true)
|
||||
echo "$OUTPUT"
|
||||
|
||||
if echo "$OUTPUT" | grep -q "\[bridge-swarm-host\] ready"; then
|
||||
echo "PASS: binary started successfully"
|
||||
else
|
||||
echo "FAIL: binary did not print ready signal"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: List release artifacts
|
||||
run: |
|
||||
echo "=== releases/ ==="
|
||||
find releases/ -type f | sort
|
||||
echo ""
|
||||
find releases/ -type f -exec ls -lh {} \; | awk '{print $5, $9}'
|
||||
|
||||
- name: Generate checksums
|
||||
run: |
|
||||
cd releases
|
||||
find . -name "*.zip" -o -name "*.xpi" | sort | xargs sha256sum > SHA256SUMS.txt
|
||||
cat SHA256SUMS.txt
|
||||
|
||||
- name: Publish release
|
||||
uses: gitea.com/actions/gitea-release-action@latest
|
||||
with:
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
tag_name: ${{ gitea.ref_name }}
|
||||
name: BridgeSwarm ${{ gitea.ref_name }}
|
||||
files: |-
|
||||
releases/*.zip
|
||||
releases/*.xpi
|
||||
releases/SHA256SUMS.txt
|
||||
sha256sum: false
|
||||
Reference in New Issue
Block a user