Update Swagger.json (12205608606) #351
This file contains 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 client library' | |
on: | |
pull_request: | |
paths: | |
- 'yaml/*.yaml' | |
- 'yaml/*.json' | |
- 'pom.xml' | |
- '.github/workflows/generate_library.yml' | |
workflow_dispatch: | |
jobs: | |
generate-client-library: | |
name: "Generate and update client library" | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'pyansys-bot[bot]' }} | |
env: | |
IS_RELEASE_BRANCH: ${{ (github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release/')) || (github.event_name == 'workflow_dispatch' && startsWith(github.ref_name, 'release/')) }} | |
steps: | |
- name: "Get Bot Application Token" | |
id: get_workflow_token | |
uses: peter-murray/workflow-application-token-action@v4 | |
with: | |
application_id: ${{ secrets.BOT_APPLICATION_ID }} | |
application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }} | |
- name: "Checkout repository" | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.get_workflow_token.outputs.token }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: "Set up JDK 11" | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
cache: maven | |
- name: "Clean library folder" | |
run: find . ! -name 'poetry.lock' -type f -exec rm -f {} + | |
working-directory: ansys-grantami-serverapi-openapi | |
- name: "Build client library" | |
run: mvn -Dbuild-id=${{ github.run_number }} ${{ env.IS_RELEASE_BRANCH == 'true' && '-Dis-release' || '' }} -s .m2/settings.xml compile | |
env: | |
MAVEN_OPTS: "-Dlog4j2.formatMsgNoLookups=true" | |
SERVER_USERNAME: ${{ secrets.REPO_USER }} | |
SERVER_PASSWORD: ${{ secrets.REPO_TOKEN }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: "Ensure poetry.lock file is up to date" | |
run: | | |
pip install poetry | |
poetry lock --no-update | |
working-directory: ansys-grantami-serverapi-openapi | |
- name: "Install and run pre-commit" | |
run: | | |
pip install pre-commit | |
git add ansys-grantami-serverapi-openapi/ | |
! pre-commit run --all-files | |
- name: "Commit changes to library code" | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: 'ansys-grantami-serverapi-openapi' | |
committer_name: 'GitHub Actions' | |
committer_email: '[email protected]' | |
message: 'Generate Client Library code - Automated' |