Migrate to Speakeasy workflows
The workflow.yaml
file allows you to define all the relevant pieces of your SDK generation as consistent configs in a single place.
This new generation system is entirely portable. Generate your SDKs locally, from GitHub, or from any CI system with absolute consistency.
Who needs to migrate?
Customers who started with Speakeasy in March 2024 or later are likely already using Speakeasy workflows. You can verify this by checking the folders in your generated SDK. If your SDK contains a .speakeasy
folder, you are already using workflows.
If you started using Speakeasy before March 2024, follow the steps below to migrate to workflows.
Migration steps
If you have an existing Speakeasy SDK in GitHub, we’ve set up an easy migration tool for you to use. Navigate to the root of your repo and run the following command:
speakeasy migrate
You should see the following changes as a result:
.speakeasy/workflow.yaml
[NEW].github/workflows/sdk_generation_action.yaml
[UPDATED]
Push these changes up and you are ready to go!
The produced files should look something like the following:
name: Generatepermissions:checks: writecontents: writepull-requests: writestatuses: write"on":workflow_dispatch:inputs:force:description: Force generation of SDKstype: booleandefault: falseschedule:- cron: 0 0 * * *jobs:generate:uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15with:force: ${{ github.event.inputs.force }}mode: prsecrets:github_access_token: ${{ secrets.GITHUB_TOKEN }}speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
workflowVersion: 1.0.0speakeasyVersion: latestsources:openapi:inputs:- location: https://raw.githubusercontent.com/speakeasy-sdks/template-speakeasy-bar/main/openapi.yamltargets:my-target:target: typescriptsource: openapi
You can now generate your SDK locally using speakeasy run
, while GitHub Actions automated generations will continue working as before.
If you have any custom code in your current GitHub Actions workflow, it should automatically be moved over by the migration script.
If you have any issues migrating to workflows, reach out to the Speakeasy team on Slack and we will help you resolve it quickly.
Creating a new SDK repo
If you prefer to migrate by creating a new SDK repo, we have an easy-to-use command for setting up an SDK for your preferred specification and language.
Create a new repo and run the following commands from the root directory:
speakeasy quickstartspeakeasy configure github
Once your repo has been created, copy the gen.yaml
from your old SDK into .speakeasy/gen.yaml
in your new SDK repo. You’re ready to generate!