Workflow matrix
TIP
To quickly set up the workflow, run
speakeasy configure github
in the root of the SDK repository. This automates the setup and commits the necessary files. For more complex or custom configurations, the following is supported. Workflow inputs
"on":workflow_dispatch:inputs:force:description: Force generation of SDKstype: booleandefault: falseset_version:description: optionally set a specific SDK versiontype: string
The inputs to the workflow determine how the SDKs will be generated.
Input Name | Description | Type | Default |
---|---|---|---|
force | Forces SDK generation even if no changes are detected in the OpenAPI document. | boolean | false |
set_version | Optionally set a specific version for the SDKs. | string | N/A |
Workflow jobs
The generate job utilizes the Speakeasy SDK generation action. It references the workflow-executor.yaml
from the sdk-generation-action
repo, which handles the core operations like pulling the OpenAPI document, validating it, and generating the SDKs.
With
jobs:generate:uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15with:force: ${{ github.event.inputs.force }}mode: prset_version: ${{ github.event.inputs.set_version }}speakeasy_version: latest
Input Name | Description | Type | Default |
---|---|---|---|
speakeasy_version | Version of the Speakeasy CLI to use. Use “latest” to always use the latest version. | string | latest |
mode | Workflow mode: direct commits changes directly to the branch, pr creates a pull request, test fully runs through generation without modifying any GitHub state. | string | direct |
force | Forces SDK generation, even if no changes are detected. | boolean | false |
set_version | Manually set a specific version for the SDK being generated. | string | None |
Secrets
secrets:github_access_token: ${{ secrets.GITHUB_TOKEN }}npm_token: ${{ secrets.NPM_TOKEN }}speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
Secret Name | Description |
---|---|
github_access_token | GitHub access token with write access to the repository. Used to push changes and create PRs. |
speakeasy_api_key | API key for authenticating with the Speakeasy CLI. |
npm_token | Token to authenticate publishing to npm registry. |
pypi_token | Token to authenticate publishing to PyPi for Python packages. |
packagist_token | Token to authenticate publishing to Packagist for PHP packages. |
ossrh_username | Username for publishing the Java package to the OSSRH repository. |
ossrh_password | Password for publishing the Java package to the OSSRH repository. |
java_gpg_secret_key | GPG secret key used for signing the Java package. |
java_gpg_passphrase | Passphrase for the GPG secret key. |
rubygems_auth_token | Auth token (API key) for publishing to RubyGems. |
nuget_api_key | API key for publishing to the Nuget registry. |
slack_webhook_url | Optional: Slack Webhook URL for posting workflow failure notifications. |
terraform_gpg_secret_key | GPG secret key used for signing the Terraform provider. |
terraform_gpg_passphrase | Passphrase for the Terraform GPG secret key. |
Workflow outputs
The workflow provides outputs that indicate which SDKs were regenerated and can trigger further actions in the pipeline, such as publishing the SDKs.
Output Name | Description |
---|---|
python_regenerated | Indicates if the Python SDK was regenerated. |
python_directory | Directory where the Python SDK was generated. |
typescript_regenerated | Indicates if the TypeScript SDK was regenerated. |
typescript_directory | Directory where the TypeScript SDK was generated. |
java_regenerated | Indicates if the Java SDK was regenerated. |
java_directory | Directory where the Java SDK was generated. |
go_regenerated | Indicates if the Go SDK was regenerated. |
go_directory | Directory where the Go SDK was generated. |
php_regenerated | Indicates if the PHP SDK was regenerated. |
php_directory | Directory where the PHP SDK was generated. |
ruby_regenerated | Indicates if the Ruby SDK was regenerated. |
ruby_directory | Directory where the Ruby SDK was generated. |
swift_regenerated | Indicates if the Swift SDK was regenerated. |
swift_directory | Directory where the Swift SDK was generated. |
terraform_regenerated | Indicates if the Terraform SDK was regenerated. |
terraform_directory | Directory where the Terraform SDK was generated. |
docs_regenerated | Indicates if the SDK documentation was regenerated. |
branch_name | The branch name used for generating the SDK or the PR. |
commit_hash | The commit hash generated for the SDK (in direct mode). |