Update Swagger.json (22162373275) #1002
Workflow file for this run
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 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-ci-bot' && github.event.action == 'synchronize') }} | |
| 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: "Checkout repository" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} # Required to trigger CI workflow following git push | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| - name: "Set up JDK 11" | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #v5.2.0 | |
| with: | |
| java-version: '11' | |
| distribution: 'adopt' | |
| cache: maven | |
| - name: "Clean library folder" | |
| run: find . ! -name 'uv.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 }} | |
| - name: "Install uv" | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0 | |
| with: | |
| python-version: 3.12 | |
| - name: "Ensure uv.lock file is up to date" | |
| run: | | |
| uv lock | |
| working-directory: ansys-grantami-serverapi-openapi | |
| - name: "Install and run pre-commit" | |
| run: | | |
| uv tool 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@a94899bca583c204427a224a7af87c02f9b325d5 #v9.1.4 | |
| with: | |
| add: 'ansys-grantami-serverapi-openapi' | |
| committer_name: 'GitHub Actions' | |
| committer_email: 'actions@github.com' | |
| message: 'Generate Client Library code - Automated' |