Skip to content

Commit

Permalink
try fix actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe7s committed Aug 16, 2024
1 parent 15ef7c6 commit aa874c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ jobs:
- run: java --version

- name: Generate Source
run: ./genSrc.sh --log="INFO" --tabLength=2 --sourceDirectory="programs/src/main/java" --rpc="${{ secrets.RPC_URL }}" --baseDelayMillis=200 --numThreads=5
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.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GPR_TOKEN }}
GITHUB_SAVA_USER: ${{ secrets.GPR_USER }}
GITHUB_SAVA_TOKEN: ${{ secrets.GPR_TOKEN }}

- name: Gradle Check
run: ./gradlew -Pgpr.sava.user=${{ secrets.GPR_USER }} -Pgpr.sava.token=${{ secrets.GPR_TOKEN }} -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace --no-daemon
run: ./gradlew -PtargetJava=${{ vars.JAVA_VERSION }} check --stacktrace --no-daemon
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SAVA_USER: ${{ secrets.GPR_USER }}
GITHUB_SAVA_TOKEN: ${{ secrets.GPR_TOKEN }}
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ subprojects {
maven {
url = "https://maven.pkg.github.com/sava-software/solana-programs"
credentials {
username = project.findProperty("gpr.sava.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.sava.token") ?: System.getenv("GITHUB_TOKEN")
username = project.findProperty("gpr.sava.user") ?: System.getenv("GITHUB_SAVA_USER")
password = project.findProperty("gpr.sava.token") ?: System.getenv("GITHUB_SAVA_TOKEN")
}
}
maven {
url = "https://maven.pkg.github.com/sava-software/anchor-src-gen"
credentials {
username = project.findProperty("gpr.sava.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.sava.token") ?: System.getenv("GITHUB_TOKEN")
username = project.findProperty("gpr.sava.user") ?: System.getenv("GITHUB_SAVA_USER")
password = project.findProperty("gpr.sava.token") ?: System.getenv("GITHUB_SAVA_TOKEN")
}
}
mavenCentral()
Expand Down
9 changes: 5 additions & 4 deletions genSrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# ./genSrc.sh --log="INFO" --tabLength=2 --sourceDirectory="anchor-programs/src/main/java" --basePackageName="software.sava.anchor.programs"
set -e

readonly JAVA_VERSION="22"

readonly projectName="generator"
readonly moduleName="software.sava.anchor_generator"
readonly package="software.sava.anchor.programs"
Expand All @@ -19,6 +17,7 @@ javaArgs=(
)

screen=0;
targetJavaVersion=22
logLevel="INFO";
tabLength=2;
sourceDirectory="src/main/java";
Expand Down Expand Up @@ -59,6 +58,8 @@ do
esac
;;

tjv | targetJavaVersion) targetJavaVersion="$val";;

bdm | baseDelayMillis) baseDelayMillis="$val";;
bp | basePackageName) basePackageName="$val";;
mn | moduleName) outputModuleName="$val";;
Expand Down Expand Up @@ -90,8 +91,8 @@ javaArgs+=("-D$moduleName.tabLength=$tabLength")

javaVersion=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | grep -oEi '^[0-9]+')
readonly javaVersion
if [[ "$javaVersion" -ne "$JAVA_VERSION" ]]; then
echo "Invalid Java version $javaVersion must be $JAVA_VERSION."
if [[ "$javaVersion" -ne "$targetJavaVersion" ]]; then
echo "Invalid Java version $javaVersion must be $targetJavaVersion."
exit 3
fi

Expand Down

0 comments on commit aa874c7

Please sign in to comment.