Bump Python SDK version #16
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: Bump Python SDK version | |
| on: [workflow_dispatch] | |
| jobs: | |
| bump-version: | |
| runs-on: ubuntu-latest | |
| env: | |
| GIT_OPENAPI_REPO_ID: openapi-fattureincloud | |
| GIT_USER_ID: fattureincloud | |
| steps: | |
| - id: checkout-openapi | |
| name: Checkout OpenAPI repo | |
| env: | |
| GIT_OPENAPI_REPO_PATH: '${{ env.GIT_USER_ID }}/${{ env.GIT_OPENAPI_REPO_ID }}' | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ./openapi | |
| ref: master | |
| repository: ${{ env.GIT_OPENAPI_REPO_PATH }} | |
| token: ${{ secrets.FATTUREINCLOUD_BOT_TOKEN }} | |
| - id: setup-libraries | |
| name: Install libraries | |
| run: | | |
| wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq | |
| chmod +x /usr/local/bin/yq | |
| yq --version | |
| - id: read-openapi-version | |
| name: Read OpenAPI Version | |
| run: | | |
| OPENAPI_VERSION=$(yq e '.info.version' ./openapi/openapi.yaml) | |
| echo "openapi_version=$OPENAPI_VERSION" >> $GITHUB_ENV | |
| # We trigger the SDK generation from OpenAPI repo to bump version also in the generated code | |
| - id: trigger-event | |
| name: Trigger Event | |
| env: | |
| GIT_OPENAPI_REPO_PATH: '${{ env.GIT_USER_ID }}/${{ env.GIT_OPENAPI_REPO_ID }}' | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.FATTUREINCLOUD_BOT_TOKEN }} | |
| repository: ${{ env.GIT_OPENAPI_REPO_PATH }} | |
| event-type: generate-python | |
| client-payload: '{"version": "${{ env.openapi_version }}", "from-openapi": false}' |