Skip to content

Commit

Permalink
move to oracle-actions/setup-java
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Aug 17, 2024
1 parent 838c481 commit fb481b9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 49 deletions.
35 changes: 13 additions & 22 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,29 @@ jobs:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3

- uses: actions/setup-java@v4
- uses: oracle-actions/setup-java@v1
if: ${{ vars.GRADLE_JAVA_VERSION != vars.JAVA_VERSION }}
with:
distribution: ${{ vars.JAVA_VENDOR }}
java-version: ${{ vars.GRADLE_JAVA_VERSION }}
java-package: jre
cache: 'gradle'
website: jdk.java.net
release: ${{ vars.GRADLE_JAVA_VERSION }}

- run: printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
- run: |
printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
java --version
if: ${{ vars.GRADLE_JAVA_VERSION != vars.JAVA_VERSION }}
- uses: actions/setup-java@v4
- uses: oracle-actions/setup-java@v1
with:
distribution: ${{ vars.JAVA_VENDOR }}
java-version: ${{ vars.JAVA_VERSION }}
check-latest: true
website: jdk.java.net
release: ${{ vars.JAVA_VERSION }}

- run: printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
if: ${{ vars.GRADLE_JAVA_VERSION == vars.JAVA_VERSION }}

- run: printf "\norg.gradle.java.installations.paths=%s" "$JAVA_HOME" >> gradle.properties

- run: java --version

- name: Generate Source
run: ./genSrc.sh --tjv="${{ vars.JAVA_VERSION }}" --log="INFO" --tl=2 --bdm=200 --nt=5 --sd="programs/src/main/java" --rpc="${{ secrets.RPC_URL }}"
env:
GITHUB_ACTOR: ${{ secrets.GPR_USER }}
GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }}

- name: Gradle Check
run: ./gradlew -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace
- name: Generate Source & Check
run: |
./genSrc.sh --tjv="${{ vars.JAVA_VERSION }}" --log="INFO" --tl=2 --bdm=200 --nt=5 --sd="programs/src/main/java" --rpc="${{ secrets.RPC_URL }}"
./gradlew -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
40 changes: 13 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,31 @@ jobs:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3

- uses: actions/setup-java@v4
- uses: oracle-actions/setup-java@v1
if: ${{ vars.GRADLE_JAVA_VERSION != vars.JAVA_VERSION }}
with:
distribution: ${{ vars.JAVA_VENDOR }}
java-version: '23-ea'
java-package: jre
cache: 'gradle'
website: jdk.java.net
release: ${{ vars.GRADLE_JAVA_VERSION }}

- run: printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
- run: |
printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
java --version
if: ${{ vars.GRADLE_JAVA_VERSION != vars.JAVA_VERSION }}
- uses: actions/setup-java@v4
- uses: oracle-actions/setup-java@v1
with:
distribution: ${{ vars.JAVA_VENDOR }}
java-version: ${{ vars.JAVA_VERSION }}
check-latest: true
website: jdk.java.net
release: ${{ vars.JAVA_VERSION }}

- run: printf "org.gradle.java.home=%s" "$JAVA_HOME" > gradle.properties
if: ${{ vars.GRADLE_JAVA_VERSION == vars.JAVA_VERSION }}

- run: printf "\norg.gradle.java.installations.paths=%s" "$JAVA_HOME" >> gradle.properties

- run: java --version

- name: Generate Source
run: ./genSrc.sh --tjv="${{ vars.JAVA_VERSION }}" --log="INFO" --tl=2 --bdm=200 --nt=5 --sd="programs/src/main/java" --rpc="${{ secrets.RPC_URL }}"
env:
GITHUB_ACTOR: ${{ secrets.GPR_USER }}
GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }}

- name: Gradle Check
run: ./gradlew -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace
- name: Generate Source, Check & Publish
run: |
./genSrc.sh --tjv="${{ vars.JAVA_VERSION }}" --log="INFO" --tl=2 --bdm=200 --nt=5 --sd="programs/src/main/java" --rpc="${{ secrets.RPC_URL }}"
./gradlew --stacktrace -PtargetJava=${{ vars.JAVA_VERSION }} check :anchor-programs:publish
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SAVA_USER: ${{ secrets.GPR_USER }}
GITHUB_SAVA_TOKEN: ${{ secrets.GPR_TOKEN }}

- name: Github Packages
run: ./gradlew -Pgpr.sava.user=${{ secrets.GPR_USER }} -Pgpr.sava.token=${{ secrets.GPR_TOKEN }} -PtargetJava=${{ vars.JAVA_VERSION }} :anchor-programs:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit fb481b9

Please sign in to comment.