Implement multi-platform build system with pure Go support
- Introduced a comprehensive build system that supports multiple platforms (Linux, macOS, Windows, Android) using pure Go builds (`CGO_ENABLED=0`). - Updated all build and test scripts to ensure compatibility with the new purego approach, allowing for dynamic loading of `libsecp256k1` at runtime. - Added detailed documentation on the build process, platform detection, and deployment options. - Enhanced CI/CD workflows to automate builds for all supported platforms and include necessary libraries in releases. - Updated `.gitignore` to exclude build output files. - Created new documentation files for deployment and multi-platform build summaries.
This commit is contained in:
@@ -48,6 +48,11 @@ COPY . .
|
||||
# Build the relay
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -gcflags "all=-N -l" -o relay .
|
||||
|
||||
# Copy libsecp256k1.so if it exists in the repo
|
||||
RUN if [ -f pkg/crypto/p8k/libsecp256k1.so ]; then \
|
||||
cp pkg/crypto/p8k/libsecp256k1.so /build/; \
|
||||
fi
|
||||
|
||||
# Create non-root user (uid 1000) for runtime in builder stage (used by analyzer)
|
||||
RUN useradd -u 1000 -m -s /bin/bash appuser && \
|
||||
chown -R 1000:1000 /build
|
||||
@@ -66,6 +71,9 @@ WORKDIR /app
|
||||
# Copy binary from builder
|
||||
COPY --from=builder /build/relay /app/relay
|
||||
|
||||
# Copy libsecp256k1.so if it was built with the binary
|
||||
COPY --from=builder /build/libsecp256k1.so /app/libsecp256k1.so 2>/dev/null || true
|
||||
|
||||
# Create runtime user and writable directories
|
||||
RUN useradd -u 1000 -m -s /bin/bash appuser && \
|
||||
mkdir -p /data /profiles /app && \
|
||||
|
||||
Reference in New Issue
Block a user