Skip to content

Commit

Permalink
Update Alpine packaging workflow and script to ensure correct binary …
Browse files Browse the repository at this point in the history
…locations
  • Loading branch information
0xdevcollins committed Oct 2, 2024
1 parent 0ce7141 commit 4e97f10
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/release-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ jobs:
run: |
apk add --no-cache \
alpine-sdk \
cmake \
git \
curl \
bash \
libdw
build-base \
boost-dev \
gmp-dev
- name: Build Stone Prover binaries
run: |
mkdir build && cd build
cmake ..
make -j$(nproc)
mkdir -p /usr/local/bin
cp cpu_air_prover cpu_air_verifier /usr/local/bin/
chmod +x /usr/local/bin/cpu_air_prover /usr/local/bin/cpu_air_verifier
- name: Create Alpine package
run: |
Expand Down
20 changes: 11 additions & 9 deletions package_alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ set -e
apk add --no-cache alpine-sdk build-base

# Define the binary paths
PROVER_PATH="/usr/local/bin/cpu_air_prover"
VERIFIER_PATH="/usr/local/bin/cpu_air_verifier"
PROVER_PATH=$(which cpu_air_prover)
VERIFIER_PATH=$(which cpu_air_verifier)

# Check if the binaries exist
if [ ! -f "$PROVER_PATH" ]; then
echo "Error: $PROVER_PATH not found. Please ensure the binary is built and available."
if [ -z "$PROVER_PATH" ]; then
echo "Error: cpu_air_prover not found in PATH. Please ensure the binary is built and available."
exit 1
fi

if [ ! -f "$VERIFIER_PATH" ]; then
echo "Error: $VERIFIER_PATH not found. Please ensure the binary is built and available."
if [ -z "$VERIFIER_PATH" ]; then
echo "Error: cpu_air_verifier not found in PATH. Please ensure the binary is built and available."
exit 1
fi

Expand All @@ -41,16 +41,18 @@ arch="all"
license="GPL-3.0"
depends="libdw"
source=""
builddir=""
builddir="/tmp/stone-prover"
package() {
install -Dm755 \$srcdir/usr/bin/cpu_air_prover \$pkgdir/usr/bin/cpu_air_prover
install -Dm755 \$srcdir/usr/bin/cpu_air_verifier \$pkgdir/usr/bin/cpu_air_verifier
mkdir -p "\$pkgdir/usr/bin"
install -Dm755 "\$builddir"/usr/bin/cpu_air_prover "\$pkgdir"/usr/bin/cpu_air_prover
install -Dm755 "\$builddir"/usr/bin/cpu_air_verifier "\$pkgdir"/usr/bin/cpu_air_verifier
}
EOF

# Build the Alpine package using abuild
cd /tmp/stone-prover
abuild checksum
abuild -r

# Output the built package location
Expand Down

0 comments on commit 4e97f10

Please sign in to comment.