Use JDK 22 on github actions as AGP requires java 17 and above #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
# Only run on push to main branch | |
push: | |
branches: | |
- main | |
# Always run on PRs | |
pull_request: | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: 'macos-latest' | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Gradle Wrapper Validation | |
uses: gradle/actions/wrapper-validation@v4 | |
- name: Install JDK 22 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '22' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build with Gradle | |
run: ./gradlew build | |
publish: | |
if: github.repository == 'sproctor/compose-data-table' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
needs: [build] | |
runs-on: macos-latest | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Gradle Wrapper Validation | |
uses: gradle/actions/wrapper-validation@v4 | |
- name: Install JDK 22 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '22' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Publish release | |
run: ./gradlew publish --no-configuration-cache | |
if: success() | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }} |