Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build on pull request against master

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Set Java 8 up
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'

- name: Build docker container
run: docker build -t native-libs .

- name: Build native library
run: docker run --rm -v $(pwd)/build:/native/build native-libs

- name: Print checksums
run: sha256sum ./build/libs/*

- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
path: ./build/libs/*
19 changes: 12 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ task buildAltbn128(group: 'altbn128', description: 'builds altbn128 library with

task buildSecp256k1CurrentOS(group: 'secp256k1', description: 'builds secp256k1 library for current OS (helpful for development)') {
dependsOn 'cleanSecp256k1'
dependsOn 'replaceJniHeaders'
doLast {
exec {
workingDir 'secp256k1'
Expand Down Expand Up @@ -193,6 +194,7 @@ task buildSecp256k1CurrentOS(group: 'secp256k1', description: 'builds secp256k1

task buildSecp256k1Cross(group: 'secp256k1', description: 'builds secp256k1 for Linux, Mac and Windows (only linux library supports reproducibility)') {
dependsOn 'cleanSecp256k1'
dependsOn 'replaceJniHeaders'
doLast {
exec {
workingDir 'secp256k1'
Expand Down Expand Up @@ -255,13 +257,16 @@ task generateJniHeaders(group: 'JNI', type: JavaCompile, description: 'generates
}

task replaceJniHeaders(group: 'JNI', description: 'Replaces JNI old headers with generated headers (for each library)') {
copy {
from 'build/generated/jni/org_bitcoin_NativeSecp256k1.h'
into 'secp256k1/jni/'
}
copy {
from 'build/generated/jni/org_bitcoin_Secp256k1Context.h'
into 'secp256k1/jni/'
dependsOn 'generateJniHeaders'
doLast {
copy {
from "${buildDir}/generated/jni/org_bitcoin_NativeSecp256k1.h"
into "${rootDir}/secp256k1/jni/"
}
copy {
from "${buildDir}/generated/jni/org_bitcoin_Secp256k1Context.h"
into "${rootDir}/secp256k1/jni/"
}
}
}

Expand Down