Merge pull request #79 from openfga/dependabot/gradle/dependencies-79… #63
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: Java CI with Gradle | |
on: | |
merge_group: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test and Build OpenFGA | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [11, 17, 21] | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Set up JDK | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: "temurin" | |
cache: gradle | |
- name: Set up Gradle | |
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 | |
- name: Test and Build with Gradle | |
run: | | |
./gradlew build test-integration | |
- if: matrix.java == 11 | |
name: Upload coverage to Codecov | |
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0 | |
continue-on-error: true | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: openfga/java-sdk | |
publish-maven-central: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [test] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Set up JDK | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
java-version: 11 | |
distribution: "temurin" | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 # v3.3.2 | |
- name: Publish package | |
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 | |
with: | |
# Tasks created by https://github.com/gradle-nexus/publish-plugin | |
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} | |
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} | |
publish-github-packages: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [test] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Set up JDK | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
java-version: 11 | |
distribution: "temurin" | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 # v3.3.2 | |
- name: Publish package | |
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 | |
with: | |
# Tasks created by https://docs.gradle.org/current/userguide/publishing_maven.html | |
arguments: publishAllPublicationsToGitHubPackagesRepository | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} | |
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} | |
create-release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [publish-maven-central, publish-github-packages] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- uses: Roang-zero1/github-create-release-action@57eb9bdce7a964e48788b9e78b5ac766cb684803 # v3.0.1 | |
with: | |
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |