Update OAS for Preview #273
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: Generate Java Sources | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'api-specifications/**' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 8 | |
| distribution: temurin | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.9' | |
| - name: Setup SSH Agent for git operations | |
| uses: webfactory/ssh-agent@v0.9.1 | |
| with: | |
| ssh-private-key: ${{ secrets.JAVA_SDK_REPO_PRIVATE_KEY }} | |
| - name: Generate SDKs | |
| run: ./gradlew :generator:java:generateClient | |
| shell: bash | |
| - name: Test SDKs | |
| run: python ./scripts/test_sdk.py --language java | |
| shell: bash | |
| env: | |
| RETAILMEDIA_TEST_CLIENT_ID: ${{ secrets.RETAILMEDIA_SDK_TEST_CLIENT_ID }} | |
| RETAILMEDIA_TEST_CLIENT_SECRET: ${{ secrets.RETAILMEDIA_SDK_TEST_CLIENT_SECRET }} | |
| RETAILMEDIA_TEST_APPLICATION_ID: ${{ secrets.RETAILMEDIA_SDK_TEST_APPLICATION_ID }} | |
| MARKETINGSOLUTIONS_TEST_CLIENT_ID: ${{ secrets.MARKETINGSOLUTIONS_SDK_TEST_CLIENT_ID }} | |
| MARKETINGSOLUTIONS_TEST_CLIENT_SECRET: ${{ secrets.MARKETINGSOLUTIONS_SDK_TEST_CLIENT_SECRET }} | |
| MARKETINGSOLUTIONS_TEST_APPLICATION_ID: ${{ secrets.MARKETINGSOLUTIONS_SDK_TEST_APPLICATION_ID }} | |
| COMMERCEGRID_TEST_CLIENT_ID: ${{ secrets.COMMERCEGRID_SDK_TEST_CLIENT_ID }} | |
| COMMERCEGRID_TEST_CLIENT_SECRET: ${{ secrets.COMMERCEGRID_SDK_TEST_CLIENT_SECRET }} | |
| COMMERCEGRID_TEST_APPLICATION_ID: ${{ secrets.COMMERCEGRID_SDK_TEST_APPLICATION_ID }} | |
| - name: Upload SDKs | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: generated-sources-java | |
| path: ./generated-sources/java | |
| - name: Push SDKs | |
| run: python ./scripts/push_sdk.py --language java | |
| shell: bash | |
| - name: Send success notification | |
| if: ${{ success() }} | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| status: "${{ job.status }}" | |
| channel: "C02J0CWR789" | |
| username: "sdk-generation-bot" | |
| text: "Java build succeeded. <https://github.com/criteo/criteo-api-sdk-generator/actions/runs/${{github.run_id}}|Link to build>." | |
| icon_emoji: ":green_check_mark:" | |
| - name: Send failure notification | |
| if: ${{ failure() }} | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| status: "${{ job.status }}" | |
| channel: "C02J0CWR789" | |
| username: "sdk-generation-bot" | |
| text: "Java build failed. <https://github.com/criteo/criteo-api-sdk-generator/actions/runs/${{github.run_id}}|Link to build>." | |
| icon_emoji: ":x:" |