Generate a key: gpg --gen-key. Note the key ID (e.g., CA925CD6C9E8D064FF05B4728190C4130ABA0F98) and short ID (e.g., 0ABA0F98).
Send the key: gpg --keyserver keys.openpgp.org --send-keys <keyId>
Note: The following key servers can also be used: keyserver.ubuntu.com, keys.openpgp.org, or pgp.mit.edu
Export the secret key: gpg --export-secret-keys --armor <shortId> > secret_key.asc
The file secret_key.asc will contain the GPG secret key.
Store the following secrets Github actions secrets:
OSSRH_USERNAME (the Sonatype username generated in Step 2)
OSSRH_PASSWORD (the corresponding password/token generated in Step 2)
JAVA_GPG_SECRET_KEY (the exported GPG key)
JAVA_GPG_PASSPHRASE (the passphrase for your GPG key)
In the java section of gen.yaml, provide the additional configuration required for publishing to Maven:
java: #ensure the `groupID` matches the OSSRH org groupID: com.example #ensure the `artificatID` matches the artifact name: artifactID: example-sdk githubURL: github.com/org/repo companyName: My Company companyURL: https://www.mycompany.com companyEmail: info@mycompany.com
Set the Package Owner field to the user or organization that will “own” the SDK artifact.
Ensure the API key has the relevant Push scope. If the package already exists, the API key may not need “Push new packages and package versions” permissions.
Populate the Glob Pattern and Available Packages fields in a way that allows publishing the SDK. Use the packageName specified in the gen.yaml file.
Store the NUGET_API_KEY in the GitHub Actions secrets.
In the C# section of gen.yaml add:
csharp: packageName: MyPackageName # Ensure this matches the desired NuGet package ID packageTags: sdk api client # Provide space-separated tags for searching on NuGet enableSourceLink: true # Enables publishing with Source Link for better debugging includeDebugSymbols: true # Includes .pdb files for publishing a symbol package (.snupkg)
In the info section of the OpenAPI document, describe what the package is for in the description property. It will be set as the Package description , visible when searching for the package on NuGet.
openapi: 3.1.0info: description: This description will be visible when searching for the package on NuGet.
In the externalDocs section of the OpenAPI document, provide the website’s homepage in the url property. It will be set as the Project URL , visible in the package’s “About” section.
openapi: 3.1.0externalDocs: url: https://homepage.com/docs description: Public Docs
In the root of the repository:
Add a LICENSE[.md|.txt] file (see Licensing for more details).
Add a 128x128 dimension image file called icon[.jpg|.png]to display on the NuGet package page.
Review the NUGET.md file, which is similar to the main README.md but excludes the SDK Installation and Available Operations sections. For more details, see Editing SDK Docs.
PHP
Create a Packagist account and manually create the Packagist package.
Navigate to Access Tokens in your account settings
Click Generate New Token and select Granular Access Token
Configure the token with the following settings:
Token name: Choose a descriptive name (e.g., speakeasy-sdk-publishing)
Expiration: Default is 7 days, but can be extended up to 1 year for automation workflows
Packages and scopes: Select Read and write permission for the packages you want to publish
For organization packages, ensure you have the appropriate organization permissions
Copy the generated token and store it securely as the NPM_TOKEN secret in your GitHub repository
Important
Granular tokens expire after the configured period (default 7 days). For CI/CD workflows, set a longer expiration period (up to 1 year) and establish a process to rotate tokens before they expire to avoid publishing failures.
Migrating from a monorepo to a dedicated repository
When moving a Speakeasy-generated SDK from within a monorepo to its own dedicated repository, follow these steps to ensure a smooth transition.
Setting up the new repository
Create a new repository (can be public or private)
Copy the SDK configuration files to the root of the new repository:
.speakeasy/gen.yaml
.speakeasy/workflow.yaml
overlay.yaml (if using)
Update package configuration files to reflect the new repository location:
For TypeScript: Update package.json
For Python: Update setup.py or pyproject.toml
For Go: Update go.mod
For other languages: Update the respective package metadata files
GitHub Actions configuration
Copy the GitHub Actions workflows to the new repository under .github/workflows/. Important considerations:
Remove any working_directory settings that referenced the old monorepo structure
Ensure the following secrets are configured in the new repository:
Cleaner build process without workspace dependencies
Easier configuration of linting and other tools
Simplified version control and release management
Direct GitHub issues integration for better user support
Independent versioning and release cycles
Publishing in the Speakeasy dashboard
The SDK publishing tab in the Speakeasy dashboard provides an overview of the publishing history and offers various utilities for setting up and maintaining SDK publishing.
app.speakeasy.com
If package manager secrets were not set during the initial SDK repo setup, the publishing dashboard provides an interface to attach these secrets to the repository.
app.speakeasy.com
For GitHub actions set up with mode:pr, the publishing dashboard highlights open PRs in the SDK repo that are pending release. This view displays the exact SDK version that will be published upon merging the PR.