Skip to content

Drop JDK 7 and fix CI build #231

Drop JDK 7 and fix CI build

Drop JDK 7 and fix CI build #231

Workflow file for this run

name: rollbar-java CI
on:
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: Java ${{ matrix.java }}
needs: [validation]
strategy:
matrix:
java: [8, 11]
steps:
- uses: actions/checkout@v4
- name: Fetch git tags
run: ./.github/scripts/fetch_to_tag.sh
# - name: Set up Java 17 (needed for Spring Boot 3)
# uses: actions/setup-java@v4
# with:
# java-version: 17
# distribution: 'zulu'
# cache: 'gradle'
#
# - name: Capture JDK17_HOME
# run: echo "export JDK17_HOME=\"$JAVA_HOME\"" > ~/.jdk17_home
# This is the JDK that'll run the build
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
cache: 'gradle'
- name: Environment info
run: |
./gradlew --version
echo JAVA_HOME: ${JAVA_HOME}
java -version
javac -version
- name: Android SDK info
run: |
echo ANDROID_SDK_ROOT: ${ANDROID_SDK_ROOT}
# ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --version
- name: Build
run: ./gradlew clean build
- name: Check
run: ./gradlew clean check
- name: Cleanup Gradle cache
# Recommended by https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
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 8
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: |
if test "$GITHUB_REPOSITORY" = "rollbar/rollbar-java" -a "$GITHUB_BASE_REF" = ""; then
openssl enc -aes-256-cbc -K "$SECRING_GPG_KEY" -iv "$SECRING_GPG_IV" -in "$ENCRYPTED_GPG_KEY_LOCATION" -out "$GPG_KEY_LOCATION" -d
fi &&
./.github/scripts/release.sh
- name: Cleanup Gradle cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties