Skip to content

License check

License check #1709

Workflow file for this run

name: OpenAPI Clients
on:
workflow_dispatch:
push:
branches:
- main
tags:
- '*'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main ]
jobs:
generate_and_push_openapi_clients:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- language: java
gradle_task: generateJavaClient
repo: cosmotech-api-java-client
- language: javascript
gradle_task: generateJSClient
repo: cosmotech-api-javascript-client
- language: python
gradle_task: generatePythonClient
repo: cosmotech-api-python-client
- language: csharp
gradle_task: generateCSharpClient
repo: cosmotech-api-csharp-client
- language: typescript
gradle_task: generateTypescriptClient
repo: cosmotech-api-typescript-client
concurrency:
group: ${{ matrix.language }}-openapi-client_update-${{ github.ref }}
cancel-in-progress: false
steps:
- uses: actions/checkout@v3
with:
# Fetch all tags since Gradle project version is built upon SCM
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Generate Client (${{ matrix.language }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: gradle/gradle-build-action@v2
with:
cache-disabled: false
# Cache storage space is limited for GitHub actions
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
arguments: ${{ matrix.gradle_task }}
- name: Set Git identity
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
run: |
git config --global user.email csmplatform@users.noreply.github.com
git config --global user.name "csmplatform"
- name: Generate commit message file
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
id: commitMsgGenerator
run: |
echo -e "Automatically update ${{ matrix.language }} client (ref: ${{ github.repository }}@${{ github.sha }})\n" > /tmp/commit-file.txt
echo "Co-authored-by: $GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" >> /tmp/commit-file.txt
echo "::set-output name=filePath::/tmp/commit-file.txt"
- name: Push ${{ matrix.language }} Client to ${{ matrix.repo }}
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
env:
GIT_TOKEN: ${{ secrets.OPENAPI_CLIENTS_GITHUB_PAT }}
GIT_COMMIT_MESSAGE_FILE: ${{ steps.commitMsgGenerator.outputs.filePath }}
run: |
./scripts/clients/publish_client.sh \
${{ matrix.language }} \
${{ github.actor }} \
"Automatically update ${{ matrix.language }} client (ref: ${{ github.repository }}@${{ github.sha }})"