Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .genignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pyproject.toml
examples/*
/utils/*
src/mistral/extra/*
pylintrc
128 changes: 128 additions & 0 deletions .github/workflows/update_speakeasy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Update Speakeasy SDKs
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
on:
workflow_dispatch:
inputs:
version:
description: 'Speakeasy version to update to (e.g., 1.580.2)'
required: true
type: string
targets:
description: 'Targets to update. If not provided, all targets will be updated.'
type: choice
options:
- mistralai-sdk
- mistralai-azure-sdk
- mistralai-gcp-sdk

jobs:
update-sdks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.11'

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies
run: |
poetry install --with dev

- name: Configure Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"

- name: Create branch
run: |
git checkout -b update-speakeasy-to-${{ github.event.inputs.version }}-${{ github.run_id }}

- name: Update Speakeasy SDKs
run: |
# Split targets and build command with multiple --targets flags
TARGETS_ARGS=""
for target in ${{ github.event.inputs.targets }}; do
TARGETS_ARGS="$TARGETS_ARGS --targets $target"
done

poetry run inv update-speakeasy \
--version "${{ github.event.inputs.version }}" \
$TARGETS_ARGS

- name: Check for changes
id: check-changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
echo "Files changed:"
git status --porcelain
else
echo "has_changes=false" >> $GITHUB_OUTPUT
echo "No changes detected"
fi

- name: Commit and push changes
if: steps.check-changes.outputs.has_changes == 'true'
run: |
git add .
git commit -m "Update Speakeasy SDKs to version ${{ github.event.inputs.version }}

Targets updated: ${{ github.event.inputs.targets }}

This PR was automatically generated by the Update Speakeasy workflow."
git push origin ${{ github.event.inputs.branch_name }}

- name: Create Pull Request
if: steps.check-changes.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: main
branch: ${{ github.event.inputs.branch_name }}
title: "Update Speakeasy SDKs to version ${{ github.event.inputs.version }}"
body: |
## Summary

This PR updates the Speakeasy SDKs to version `${{ github.event.inputs.version }}`.

## Changes

- **Version**: Updated to `${{ github.event.inputs.version }}`
- **Targets**: ${{ github.event.inputs.targets }}

## Files Updated

The following SDK files have been regenerated:
- Generated SDK code files
- Updated dependencies and configurations

## How to Review

1. Check that the generated files look correct
2. Verify that the version update is appropriate
3. Ensure all target SDKs are properly updated

---

*This PR was automatically generated by the [Update Speakeasy workflow](.github/workflows/update_speakeasy.yaml)*
labels: automated
assignees: ${{ github.actor }}

- name: Comment on workflow run
if: steps.check-changes.outputs.has_changes == 'false'
run: |
echo "No changes were detected. The SDKs are already up to date with version ${{ github.event.inputs.version }}."
Loading
Loading