Skip to content

Drop JDK 7 and fix CI build #263

Drop JDK 7 and fix CI build

Drop JDK 7 and fix CI build #263

Workflow file for this run

name: rollbar-java CI
on:
workflow_call:
secrets:
SECRING_GPG_IV:
required: true
SECRING_GPG_KEY:
required: true
GPG_KEY_ID:
required: true
GPG_PASSPHRASE:
required: true
NEXUS_USERNAME:
required: true
NEXUS_PASSWORD:
required: true
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
validation:
name: Gradle wrapper validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
build:
runs-on: ubuntu-latest
name: Build with Java ${{ matrix.java }}
needs: [ validation ]
strategy:
fail-fast: false
matrix:
# Must upgrade Gradle before we can go past Java 15 here.
# https://docs.gradle.org/current/userguide/compatibility.html
java: [ 8, 11 ]
steps:
- uses: actions/checkout@v4
- name: Fetch git tags
run: ./.github/scripts/fetch_to_tag.sh
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
cache: 'gradle'
# gradle/actions/setup-gradle@v3 might offer better caching and other benefits through better integration.
# https://github.com/gradle/actions/blob/main/docs/setup-gradle.md
- name: Environment info
run: |
./gradlew --version
echo JAVA_HOME: ${JAVA_HOME}
java -version
javac -version
echo ANDROID_HOME: ${ANDROID_HOME}
echo ANDROID_SDK_ROOT: ${ANDROID_SDK_ROOT}
- name: Build
run: ./gradlew clean build
- name: Upload build reports
if: always()
uses: actions/upload-artifact@v4
with:
name: java-${{ matrix.java }}-build-reports
path: |
**/build/reports/*
release:
runs-on: ubuntu-latest
name: Release
# It would be nice to run this as part of the build job, since it would be
# faster and have less duplicated Yaml, it would not be possible to check
# for all matrix results before publishing if this were just another step
# in that job.
needs: [ build ]
steps:
- uses: actions/checkout@v4
- name: Set up Java 11 for the Android SDK Manager
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
cache: 'gradle'
- name: Install Android SDK
run: |
echo "Android SDK Manager version: `${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --version`"
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-27" "build-tools;30.0.3"
- name: Set up Java 8 for the build
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
cache: 'gradle'
- name: Release
env:
SECRING_GPG_IV: ${{ secrets.SECRING_GPG_IV }}
SECRING_GPG_KEY: ${{ secrets.SECRING_GPG_KEY }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
ENCRYPTED_GPG_KEY_LOCATION: ./.github/secring.gpg.enc
GPG_KEY_LOCATION: ./.github/secring.gpg
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
openssl enc -aes-256-cbc -K "$SECRING_GPG_KEY" -iv "$SECRING_GPG_IV" -in "$ENCRYPTED_GPG_KEY_LOCATION" -out "$GPG_KEY_LOCATION" -d
./.github/scripts/temp-release.sh