diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index be046b05..81497286 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -151,6 +151,13 @@ jobs: - name: Build project run: ./mvnw.cmd -B -ntp --file pom.xml clean package + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-results-pr-windows-x86_64 + path: '**/target/surefire-reports/TEST-*.xml' + - uses: actions/upload-artifact@v2 if: ${{ failure() }} with: @@ -199,6 +206,14 @@ jobs: - name: Setup environment run: export ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }} + # Cache .m2/repository + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: android-maven-cache-${{ hashFiles('**/pom.xml') }} + restore-keys: | + android-maven-cache- + - name: Build project run: ./mvnw -B -ntp --file pom.xml clean package -Dandroid diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index c9722cf8..bcdcbd8a 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -151,10 +151,77 @@ jobs: path: local-staging if-no-files-found: error + stage-snapshot-android: + runs-on: ubuntu-latest + name: android + env: + SDK_VER: "platforms;android-21" + NDK_VER: "ndk;21.4.7075529" + steps: + - uses: actions/checkout@v2 + + - name: Setup ninja-build + run: sudo apt-get install ninja-build + + - name: Setup go + uses: actions/setup-go@v2 + + - name: Install cargo-ndk + uses: actions-rs/install@v0.1 + with: + crate: cargo-ndk + + - name: Install Rust toolchain for Android architectures + run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Install Android SDK platforms + run: sdkmanager "${{ env.SDK_VER }}" + + - name: Install Android NDK + run: sdkmanager "${{ env.NDK_VER }}" + + - name: Setup environment + run: export ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }} + + # Caching of maven dependencies + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: stage-snapshot-android-maven-cache-${{ hashFiles('**/pom.xml') }} + restore-keys: | + stage-snapshot-android-maven-cache- + + - uses: s4u/maven-settings-action@v2.2.0 + with: + servers: | + [{ + "id": "sonatype-nexus-staging", + "username": "${{ secrets.SONATYPE_USERNAME }}", + "password": "${{ secrets.SONATYPE_PASSWORD }}" + }] + + - name: Stage snapshots to local staging directory + run: ./mvnw -B -ntp --file pom.xml clean package org.sonatype.plugins:nexus-staging-maven-plugin:deploy -Dandroid -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true + + - name: Upload local staging directory + uses: actions/upload-artifact@v2 + with: + name: android-local-staging + path: local-staging + if-no-files-found: error + deploy-staged-snapshots: runs-on: ubuntu-18.04 # Wait until we have staged everything - needs: [stage-snapshot-linux, stage-snapshot-windows-x86_64] + needs: [stage-snapshot-linux, stage-snapshot-windows-x86_64, stage-snapshot-android] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 16bcad0b..79811536 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -215,6 +215,15 @@ jobs: - name: Setup environment run: export ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }} + # Cache .m2/repository + # Caching of maven dependencies + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: pr-android-maven-cache-${{ hashFiles('**/pom.xml') }} + restore-keys: | + pr-android-maven-cache- + - name: Build project run: ./mvnw -B -ntp --file pom.xml clean package -Dandroid diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 944138fb..b61c2e07 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -257,10 +257,85 @@ jobs: # Rollback the release in case of an failure run: ./.github/scripts/release_rollback.ps1 release.properties netty/netty-incubator-codec-quic main + + stage-release-android: + runs-on: ubuntu-latest + name: android + env: + SDK_VER: "platforms;android-21" + NDK_VER: "ndk;21.4.7075529" + steps: + - uses: actions/checkout@v2 + + - name: Setup ninja-build + run: sudo apt-get install ninja-build + + - name: Setup go + uses: actions/setup-go@v2 + + - name: Install cargo-ndk + uses: actions-rs/install@v0.1 + with: + crate: cargo-ndk + + - name: Install Rust toolchain for Android architectures + run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android + + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Setup Android SDK + uses: android-actions/setup-android@v2 + + - name: Install Android SDK platforms + run: sdkmanager "${{ env.SDK_VER }}" + + - name: Install Android NDK + run: sdkmanager "${{ env.NDK_VER }}" + + - name: Setup environment + run: export ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }} + + # Caching of maven dependencies + - uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: stage-snapshot-android-maven-cache-${{ hashFiles('**/pom.xml') }} + restore-keys: | + stage-snapshot-android-maven-cache- + + - uses: s4u/maven-settings-action@v2.2.0 + with: + servers: | + [{ + "id": "sonatype-nexus-staging", + "username": "${{ secrets.SONATYPE_USERNAME }}", + "password": "${{ secrets.SONATYPE_PASSWORD }}" + }] + + - name: Stage release to local staging directory + working-directory: prepare-release-workspace + run: ./mvnw -B -ntp --file pom.xml clean javadoc:jar package gpg:sign org.sonatype.plugins:nexus-staging-maven-plugin:deploy -Dandroid -DnexusUrl=https://oss.sonatype.org -DserverId=sonatype-nexus-staging -DaltStagingDirectory=local-staging -DskipRemoteStaging=true -DskipTests=true -D'checkstyle.skip=true' + + - name: Upload local staging directory + uses: actions/upload-artifact@v2 + with: + name: android-local-staging + path: prepare-release-workspace/local-staging + if-no-files-found: error + + - name: Rollback release on failure + working-directory: prepare-release-workspace + if: ${{ failure() }} + # Rollback the release in case of an failure + run: ./.github/scripts/release_rollback.ps1 release.properties netty/netty-incubator-codec-quic main + deploy-staged-release: runs-on: ubuntu-18.04 # Wait until we have staged everything - needs: [stage-release-linux, stage-release-windows-x86_64] + needs: [stage-release-linux, stage-release-windows-x86_64, stage-release-android] steps: - name: Download release-workspace uses: actions/download-artifact@v2 diff --git a/README.md b/README.md index 0087790a..734f7af8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is a new experimental QUIC codec for netty which makes use of [quiche](http ## How to include the dependency To include the dependency you need to ensure you also specify the right classifier. At the moment we only support Linux - x86_64, macOS / OSX x86_64 and Windows x86_64 but this may change. + x86_64 and aarch64, macOS / OSX x86_64, Windows x86_64 and Android but this may change. As an example this is how you would include the dependency in maven: For Linux x86_64: @@ -42,6 +42,20 @@ For Windows: ``` +For Android: + +It's a single dependency that contains the following [ABI](https://developer.android.com/ndk/guides/abis): `armeabi-v7a`, `arm64-v8a`, `x86`, `x86-64`. +If you don't need all ABI in your application, check out [abiFilters](https://developer.android.com/ndk/guides/abis#gc). + +``` + + io.netty.incubator + netty-incubator-codec-quic + 0.0.16.Final + android + +``` + ## How to use this codec ? For some examples please check our