Workflow matrix

Success Icon

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 SDKs
type: boolean
default: false
set_version:
description: optionally set a specific SDK version
type: string

The inputs to the workflow determine how the SDKs will be generated.

Input NameDescriptionTypeDefault
forceForces SDK generation even if no changes are detected in the OpenAPI document.booleanfalse
set_versionOptionally set a specific version for the SDKs.stringN/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@v15
with:
force: ${{ github.event.inputs.force }}
mode: pr
set_version: ${{ github.event.inputs.set_version }}
speakeasy_version: latest
Input NameDescriptionTypeDefault
speakeasy_versionVersion of the Speakeasy CLI to use. Use “latest” to always use the latest version.stringlatest
modeWorkflow mode: direct commits changes directly to the branch, pr creates a pull request, test fully runs through generation without modifying any GitHub state.stringdirect
forceForces SDK generation, even if no changes are detected.booleanfalse
set_versionManually set a specific version for the SDK being generated.stringNone

Secrets

secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
npm_token: ${{ secrets.NPM_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
Secret NameDescription
github_access_tokenGitHub access token with write access to the repository. Used to push changes and create PRs.
speakeasy_api_keyAPI key for authenticating with the Speakeasy CLI.
npm_tokenToken to authenticate publishing to npm registry.
pypi_tokenToken to authenticate publishing to PyPi for Python packages.
packagist_tokenToken to authenticate publishing to Packagist for PHP packages.
ossrh_usernameUsername for publishing the Java package to the OSSRH repository.
ossrh_passwordPassword for publishing the Java package to the OSSRH repository.
java_gpg_secret_keyGPG secret key used for signing the Java package.
java_gpg_passphrasePassphrase for the GPG secret key.
rubygems_auth_tokenAuth token (API key) for publishing to RubyGems.
nuget_api_keyAPI key for publishing to the Nuget registry.
slack_webhook_urlOptional: Slack Webhook URL for posting workflow failure notifications.
terraform_gpg_secret_keyGPG secret key used for signing the Terraform provider.
terraform_gpg_passphrasePassphrase 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 NameDescription
python_regeneratedIndicates if the Python SDK was regenerated.
python_directoryDirectory where the Python SDK was generated.
typescript_regeneratedIndicates if the TypeScript SDK was regenerated.
typescript_directoryDirectory where the TypeScript SDK was generated.
java_regeneratedIndicates if the Java SDK was regenerated.
java_directoryDirectory where the Java SDK was generated.
go_regeneratedIndicates if the Go SDK was regenerated.
go_directoryDirectory where the Go SDK was generated.
php_regeneratedIndicates if the PHP SDK was regenerated.
php_directoryDirectory where the PHP SDK was generated.
ruby_regeneratedIndicates if the Ruby SDK was regenerated.
ruby_directoryDirectory where the Ruby SDK was generated.
swift_regeneratedIndicates if the Swift SDK was regenerated.
swift_directoryDirectory where the Swift SDK was generated.
terraform_regeneratedIndicates if the Terraform SDK was regenerated.
terraform_directoryDirectory where the Terraform SDK was generated.
docs_regeneratedIndicates if the SDK documentation was regenerated.
branch_nameThe branch name used for generating the SDK or the PR.
commit_hashThe commit hash generated for the SDK (in direct mode).