ci: add reproducible Java SDK generation build #1
This file contains hidden or 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: Generated SDK Conformance | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| generate-and-build: | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| timeout-minutes: 12 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| cache: maven | |
| - name: Fetch immutable contract | |
| run: | | |
| curl --fail --location \ | |
| https://raw.githubusercontent.com/CoreLinkPlatform/api-contracts/5bdc07b80c8acbd0617b75e2d7ae3edd17f6324b/openapi/corelink-public-v1.yaml \ | |
| --output /tmp/corelink-public-v1.yaml | |
| - name: Fetch pinned generator | |
| run: | | |
| curl --fail --location \ | |
| https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar \ | |
| --output /tmp/openapi-generator-cli.jar | |
| - name: Generate Java client | |
| run: | | |
| rm -rf /tmp/corelink-java-sdk | |
| java -jar /tmp/openapi-generator-cli.jar generate \ | |
| -i /tmp/corelink-public-v1.yaml \ | |
| -g java \ | |
| -o /tmp/corelink-java-sdk \ | |
| --additional-properties=groupId=io.corelink,artifactId=corelink-sdk,artifactVersion=0.1.0-SNAPSHOT,invokerPackage=io.corelink.sdk,apiPackage=io.corelink.sdk.api,modelPackage=io.corelink.sdk.model,library=native,dateLibrary=java8,hideGenerationTimestamp=true \ | |
| --global-property=apiDocs=false,modelDocs=false | |
| - name: Compile generated Java SDK | |
| working-directory: /tmp/corelink-java-sdk | |
| run: mvn -B -DskipTests package |