Generate MISTRALAI-SDK #95
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 MISTRALAI-SDK | |
| permissions: | |
| checks: write | |
| contents: write | |
| pull-requests: write | |
| statuses: write | |
| "on": | |
| workflow_dispatch: | |
| inputs: | |
| force: | |
| description: Force generation of SDKs | |
| type: boolean | |
| default: false | |
| set_version: | |
| description: optionally set a specific SDK version | |
| type: string | |
| feature_branch: | |
| description: "Branch for SDK changes" | |
| required: false | |
| type: string | |
| environment: | |
| description: "Environment variables (e.g., tag=branch-name)" | |
| required: false | |
| type: string | |
| jobs: | |
| resolve-speakeasy-version: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| speakeasy_version: ${{ steps.read-version.outputs.speakeasy_version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Read Speakeasy version from workflow config | |
| id: read-version | |
| shell: bash | |
| run: | | |
| version="$(awk -F': ' '/^speakeasyVersion:/ {print $2}' .speakeasy/workflow.yaml)" | |
| if [ -z "$version" ]; then | |
| echo "Failed to resolve speakeasyVersion from .speakeasy/workflow.yaml" >&2 | |
| exit 1 | |
| fi | |
| # Strip optional leading 'v' | |
| version="${version#v}" | |
| echo "speakeasy_version=$version" >> "$GITHUB_OUTPUT" | |
| generate: | |
| needs: resolve-speakeasy-version | |
| runs-on: ubuntu-24.04 | |
| environment: publish | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.CLIENT_PIPELINE }} | |
| - name: Install Speakeasy CLI | |
| env: | |
| VERSION: ${{ needs.resolve-speakeasy-version.outputs.speakeasy_version }} | |
| run: | | |
| curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/07977787cc394cb30b418a591b3332e40e209be1/install.sh | sh | |
| speakeasy --version | |
| - name: Run SDK generation | |
| env: | |
| INPUT_GITHUB_ACCESS_TOKEN: ${{ secrets.CLIENT_PIPELINE }} | |
| SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }} | |
| INPUT_MODE: pr | |
| INPUT_FORCE: ${{ github.event.inputs.force }} | |
| INPUT_TARGET: mistralai-sdk | |
| INPUT_SET_VERSION: ${{ github.event.inputs.set_version }} | |
| INPUT_FEATURE_BRANCH: ${{ github.event.inputs.feature_branch }} | |
| INPUT_CLI_ENVIRONMENT_VARIABLES: ${{ github.event.inputs.environment }} | |
| run: speakeasy ci generate |