Browse Source

CI: copy libsecp256k1 from nostr module instead of building

Building from source was failing. The nostr module already has
a properly built libsecp256k1.so with schnorr/musig2 support.

ARM64 users need to build libsecp256k1 from source separately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
main v0.56.3
woikos 4 months ago
parent
commit
36a216574d
No known key found for this signature in database
  1. 42
      .gitea/workflows/go.yml

42
.gitea/workflows/go.yml

@ -39,8 +39,8 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
set -e set -e
echo "Installing build dependencies..." echo "Installing jq..."
sudo apt-get update && sudo apt-get install -y jq autoconf automake libtool gcc-aarch64-linux-gnu sudo apt-get update && sudo apt-get install -y jq
- name: Set up Go - name: Set up Go
run: | run: |
@ -105,30 +105,6 @@ jobs:
# Note: libsecp256k1.so is loaded at runtime via purego, not needed for tests # Note: libsecp256k1.so is loaded at runtime via purego, not needed for tests
CGO_ENABLED=0 go test -v $(go list ./... | grep -v '/cmd/benchmark/external/' | xargs -n1 sh -c 'ls $0/*_test.go 1>/dev/null 2>&1 && echo $0' | grep .) || echo "Some tests failed, continuing..." CGO_ENABLED=0 go test -v $(go list ./... | grep -v '/cmd/benchmark/external/' | xargs -n1 sh -c 'ls $0/*_test.go 1>/dev/null 2>&1 && echo $0' | grep .) || echo "Some tests failed, continuing..."
- name: Build libsecp256k1
run: |
set -e
echo "Building libsecp256k1 with schnorr/musig2 support..."
cd /tmp
git clone --depth 1 https://github.com/bitcoin-core/secp256k1.git
cd secp256k1
./autogen.sh
# Build for AMD64
echo "Building for AMD64..."
./configure --enable-module-schnorrsig --enable-module-extrakeys
make clean && make -j$(nproc)
cp .libs/libsecp256k1.so.2.2.3 /tmp/libsecp256k1-amd64.so
# Build for ARM64 (cross-compile)
echo "Building for ARM64..."
./configure --enable-module-schnorrsig --enable-module-extrakeys \
--host=aarch64-linux-gnu CC=aarch64-linux-gnu-gcc
make clean && make -j$(nproc)
cp .libs/libsecp256k1.so.2.2.3 /tmp/libsecp256k1-arm64.so
ls -la /tmp/libsecp256k1-*.so
- name: Build Release Binaries - name: Build Release Binaries
run: | run: |
set -e set -e
@ -173,10 +149,14 @@ jobs:
go build -ldflags "-s -w" -o "release-binaries/${name}-${VERSION}-linux-arm64" "${path}" go build -ldflags "-s -w" -o "release-binaries/${name}-${VERSION}-linux-arm64" "${path}"
done done
# Copy libsecp256k1.so (built with schnorr/musig2 support) # Copy libsecp256k1.so from nostr module (has schnorr/musig2)
cp /tmp/libsecp256k1-amd64.so release-binaries/libsecp256k1-linux-amd64.so NOSTR_MOD=$(go list -m -f '{{.Dir}}' git.mleku.dev/mleku/nostr)
cp /tmp/libsecp256k1-arm64.so release-binaries/libsecp256k1-linux-arm64.so if [ -f "${NOSTR_MOD}/crypto/p8k/libsecp256k1.so" ]; then
chmod +x release-binaries/libsecp256k1-linux-*.so cp "${NOSTR_MOD}/crypto/p8k/libsecp256k1.so" release-binaries/libsecp256k1-linux-amd64.so
chmod +x release-binaries/libsecp256k1-linux-amd64.so
echo "Copied libsecp256k1.so for AMD64"
fi
# Note: ARM64 users need to build libsecp256k1 from source
# Create checksums # Create checksums
cd release-binaries cd release-binaries
@ -239,7 +219,7 @@ jobs:
* orly-launcher - Process supervisor with admin UI * orly-launcher - Process supervisor with admin UI
* orly-sync-negentropy - Negentropy sync service * orly-sync-negentropy - Negentropy sync service
* orly-certs - DNS-01 wildcard certificate manager * orly-certs - DNS-01 wildcard certificate manager
* libsecp256k1 - Custom build with schnorr/musig2 support * libsecp256k1 - AMD64 only, with schnorr/musig2 support
### Architectures ### Architectures
* Linux AMD64 (x86_64) * Linux AMD64 (x86_64)

Loading…
Cancel
Save