diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f2e83b..2463e1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,11 +29,13 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} restore-keys: ${{ runner.os }}-gradle- - name: Android environment + if: matrix.os != 'windows-latest' shell: bash run: | echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV echo "ANDROID_NDK_VERSION=21.4.7075529" >> $GITHUB_ENV - name: Cached Android NDK + if: matrix.os != 'windows-latest' uses: actions/cache@v2 with: path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }} @@ -43,6 +45,19 @@ jobs: run: | echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append rm.exe "C:/WINDOWS/system32/bash.EXE" + - name: Install Automake + if: matrix.os == 'macOS-latest' + run: brew install automake + - name: Install Automake (windows) + if: matrix.os == 'windows-latest' + uses: msys2/setup-msys2@v2 + with: + path-type: minimal + update: true + install: >- + base-devel + autotools + mingw-w64-x86_64-gcc - name: Set up JDK 8 uses: actions/setup-java@v1 with: @@ -54,18 +69,19 @@ jobs: $ANDROID_HOME/tools/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION" - name: Setup Android if: matrix.os == 'windows-latest' - shell: bash + shell: msys2 {0} run: | - $ANDROID_HOME\\tools\\bin\\sdkmanager.bat "ndk;$ANDROID_NDK_VERSION" + echo "skip.android=true" > local.properties - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - - name: Install Automake - if: matrix.os == 'macOS-latest' - run: brew install automake - name: Check JVM - shell: bash + if: matrix.os != 'windows-latest' + run: ./gradlew jvmTest + - name: Check JVM (Windows) + if: matrix.os == 'windows-latest' + shell: msys2 {0} run: ./gradlew jvmTest - name: Check Linux if: matrix.os == 'ubuntu-latest' @@ -87,27 +103,15 @@ jobs: script: ./gradlew connectedCheck - name: Publish Linux if: matrix.os == 'ubuntu-latest' - env: - BINTRAY_USER: ${{ secrets.bintray_user }} - BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} shell: bash -# ./gradlew publishLinuxPublicationToBintrayRepository :jni:jvm:linux:publishJvmPublicationToBintrayRepository run: ./gradlew publishLinuxPublicationToMavenLocal :jni:jvm:linux:publishJvmPublicationToMavenLocal - name: Publish Windows if: matrix.os == 'windows-latest' - env: - BINTRAY_USER: ${{ secrets.bintray_user }} - BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} - shell: bash -# ./gradlew :jni:jvm:mingw:publishJvmPublicationToBintrayRepository + shell: msys2 {0} run: ./gradlew :jni:jvm:mingw:publishToMavenLocal - name: Publish MacOS if: matrix.os == 'macOS-latest' - env: - BINTRAY_USER: ${{ secrets.bintray_user }} - BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} shell: bash -# ./gradlew publish run: ./gradlew publishToMavenLocal - name: Copy artifact files run: | @@ -120,9 +124,3 @@ jobs: path: | maven-local !maven-local/**/maven-metadata-local.xml -# - name: Discard -# if: ${{ failure() || cancelled() }} -# env: -# BINTRAY_USER: ${{ secrets.bintray_user }} -# BINTRAY_APIKEY: ${{ secrets.bintray_apikey }} -# run: ./gradlew postBintrayDiscard diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 03b198e..a7538e3 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -54,6 +54,19 @@ jobs: run: | echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append rm.exe "C:/WINDOWS/system32/bash.EXE" + - name: Install Automake + if: matrix.os == 'macOS-latest' + run: brew install automake + - name: Install Automake (windows) + if: matrix.os == 'windows-latest' + uses: msys2/setup-msys2@v2 + with: + path-type: minimal + update: true + install: >- + base-devel + autotools + mingw-w64-x86_64-gcc - name: Set up JDK 8 uses: actions/setup-java@v1 with: @@ -63,15 +76,21 @@ jobs: shell: bash run: | $ANDROID_HOME/tools/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION" + - name: Setup Android + if: matrix.os == 'windows-latest' + shell: msys2 {0} + run: | + echo "skip.android=true" > local.properties - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - - name: Install Automake - if: matrix.os == 'macOS-latest' - run: brew install automake - name: Check JVM - shell: bash + if: matrix.os != 'windows-latest' + run: ./gradlew jvmTest + - name: Check JVM (Windows) + if: matrix.os == 'windows-latest' + shell: msys2 {0} run: ./gradlew jvmTest - name: Check Linux if: matrix.os == 'ubuntu-latest' @@ -97,7 +116,7 @@ jobs: run: ./gradlew publishLinuxPublicationToMavenLocal :jni:jvm:linux:publishJvmPublicationToMavenLocal -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }} - name: Publish Windows if: matrix.os == 'windows-latest' - shell: bash + shell: msys2 {0} run: ./gradlew :jni:jvm:mingw:publishToMavenLocal -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }} - name: Publish MacOS if: matrix.os == 'macOS-latest' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a94bebf..8ce6a0f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,11 +44,13 @@ jobs: key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} restore-keys: ${{ runner.os }}-gradle- - name: Android environment + if: matrix.os != 'windows-latest' shell: bash run: | echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV echo "ANDROID_NDK_VERSION=21.4.7075529" >> $GITHUB_ENV - name: Cached Android NDK + if: matrix.os != 'windows-latest' uses: actions/cache@v2 with: path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }} @@ -58,6 +60,19 @@ jobs: run: | echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append rm.exe "C:/WINDOWS/system32/bash.EXE" + - name: Install Automake + if: matrix.os == 'macOS-latest' + run: brew install automake + - name: Install Automake (windows) + if: matrix.os == 'windows-latest' + uses: msys2/setup-msys2@v2 + with: + path-type: minimal + update: true + install: >- + base-devel + autotools + mingw-w64-x86_64-gcc - name: Set up JDK 8 uses: actions/setup-java@v1 with: @@ -69,18 +84,19 @@ jobs: $ANDROID_HOME/tools/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION" - name: Setup Android if: matrix.os == 'windows-latest' - shell: bash + shell: msys2 {0} run: | - $ANDROID_HOME\\tools\\bin\\sdkmanager.bat "ndk;$ANDROID_NDK_VERSION" + echo "skip.android=true" > local.properties - name: Set up JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - - name: Install Automake - if: matrix.os == 'macOS-latest' - run: brew install automake - name: Check JVM - shell: bash + if: matrix.os != 'windows-latest' + run: ./gradlew jvmTest + - name: Check JVM (Windows) + if: matrix.os == 'windows-latest' + shell: msys2 {0} run: ./gradlew jvmTest - name: Check Linux if: matrix.os == 'ubuntu-latest' diff --git a/native/build.gradle.kts b/native/build.gradle.kts index cba74e3..c225e60 100644 --- a/native/build.gradle.kts +++ b/native/build.gradle.kts @@ -7,7 +7,7 @@ if (includeAndroid) { } val currentOs = OperatingSystem.current() -val bash = if (currentOs.isWindows) "bash.exe" else "bash" +val bash = "bash" val buildSecp256k1 by tasks.creating { group = "build" } @@ -27,7 +27,7 @@ val buildSecp256k1Host by tasks.creating(Exec::class) { workingDir = projectDir environment("TARGET", target) - commandLine(bash, "build.sh") + commandLine(bash, "-l", "build.sh") } val buildSecp256k1Ios by tasks.creating(Exec::class) {