Update gradle-build.yml #17
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: | |
push: | |
branches: | |
- main | |
- development | |
pull_request: | |
branches: | |
- main | |
- development | |
permissions: | |
contents: read | |
jobs: | |
validation: | |
name: "Validation" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: gradle/wrapper-validation-action@v1 | |
build: | |
name: "Build" | |
needs: validation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build --scan | |
publish: | |
name: "Publish to Nexus" | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: publish | |
env: | |
ORG_GRADLE_PROJECT_edpnNexusUsername: ${{ secrets.NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_edpnNexusPassword: ${{ secrets.NEXUS_PASSWORD }} | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: publish |