From 7b83579700f6f776b98222e6a9c17512207b00c3 Mon Sep 17 00:00:00 2001 From: "Justin \"J.R.\" Hill" Date: Sat, 26 Aug 2023 05:10:37 +0900 Subject: [PATCH] refactor(java): Misc changes - Add Java 20 to CI - Use exact hashes for CI actions - Fix broken link for models in README - Fix artifact version in build.gradle and elsewhere - Git ignore some files --- config/clients/java/config.overrides.json | 3 ++- .../java/template/.github/workflows/main.yml.mustache | 6 +++--- config/clients/java/template/README_models.mustache | 4 +++- config/clients/java/template/gitignore.mustache | 4 ++++ config/common/files/.github/workflows/semgrep.yaml | 2 +- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/config/clients/java/config.overrides.json b/config/clients/java/config.overrides.json index 4eb8e6da..61bc3c10 100644 --- a/config/clients/java/config.overrides.json +++ b/config/clients/java/config.overrides.json @@ -4,10 +4,11 @@ "packageName": "dev.openfga:openfga-sdk", "artifactId": "openfga-sdk", "groupId": "dev.openfga", + "artifactVersion": "0.0.1", + "packageVersion": "0.0.1", "apiPackage": "dev.openfga.sdk.api", "invokerPackage": "dev.openfga.sdk.api.client", "modelPackage": "dev.openfga.sdk.api.model", - "packageVersion": "0.0.1", "snapshotVersion": false, "packageDescription": "Java SDK for OpenFGA", "artifactDescription": "Java SDK for OpenFGA", diff --git a/config/clients/java/template/.github/workflows/main.yml.mustache b/config/clients/java/template/.github/workflows/main.yml.mustache index 770a141b..f23ec3a8 100644 --- a/config/clients/java/template/.github/workflows/main.yml.mustache +++ b/config/clients/java/template/.github/workflows/main.yml.mustache @@ -12,11 +12,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '11', '17' ] + java: [ '11', '17', '20' ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.2 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 with: {{=< >=}} java-version: ${{ matrix.java }} diff --git a/config/clients/java/template/README_models.mustache b/config/clients/java/template/README_models.mustache index cfea61fa..7ea24660 100644 --- a/config/clients/java/template/README_models.mustache +++ b/config/clients/java/template/README_models.mustache @@ -1 +1,3 @@ -[Models](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/blob/main/apiModel.ts) +{{#models}}{{#model}} +- [{{{classname}}}](https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/blob/main/docs/{{{classname}}}.md) +{{/model}}{{/models}} diff --git a/config/clients/java/template/gitignore.mustache b/config/clients/java/template/gitignore.mustache index a530464a..f847fdbd 100644 --- a/config/clients/java/template/gitignore.mustache +++ b/config/clients/java/template/gitignore.mustache @@ -19,3 +19,7 @@ hs_err_pid* target .gradle build + +# openapi files +/api/openapi.yaml +VERSION.txt diff --git a/config/common/files/.github/workflows/semgrep.yaml b/config/common/files/.github/workflows/semgrep.yaml index 66e24d30..44718e20 100644 --- a/config/common/files/.github/workflows/semgrep.yaml +++ b/config/common/files/.github/workflows/semgrep.yaml @@ -11,7 +11,7 @@ jobs: image: returntocorp/semgrep if: (github.actor != 'dependabot[bot]' && github.actor != 'snyk-bot') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.2 - run: semgrep ci env: SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}