Skip to main content

Deploying SDKs to GitHub

APIMatic streamlines your SDK deployment to GitHub. Just specify the target repository & branch names and the generated SDKs are automatically pushed along with version tags for easy reference.

Frequently Asked Questions

How does the GitHub deployment work?
Simply authenticate with GitHub to create the GitHub Credentials and push the SDKs to either an existing repository or a new repository of your choice.

What branch does APIMatic publish to?
When you publish your SDK to GitHub with APIMatic, you can choose any name you like for the branch.

Can I make changes to the Code in my GitHub repository?
When APIMatic publishes Source Code to your GitHub repository, it purges all existing files before committing the updated SDK. This would overwrite any changes you make. In order to prevent your changes from being overwritten, you can include updated files in the codegenignore file

Follow these steps to configure SDK Deployment to GitHub:

  • From APIMatic dashboard, navigate to the API for which you want to publish an SDK and click Generate.

    APIMatic calculator API

  • At this point, your API Specification is validated for Syntactic and Semantic correctness and you are provided with a validation summary that lists errors, warnings and informational messages. If any errors are encountered in the API definition, you will be required to fix them before proceeding. You can resolve these errors by editing the API definition via APIMatic’s no-code API editor.

    • To access the API Editor, click the Edit button. For a detailed look at how the API Editor can be used to modify your API definition, refer to APIMatic’s documentation. If you have trouble fixing validation errors and would like some guidance, drop us an email at support@apimatic.io.

      Validation summary with errors

    • If there are no errors, you can click Proceed to move to the next step.

      Validation without errors

  • On the Generate popup, click Publish Package. This should take you to a wizard that will walk you through the process of deploying SDKs for your API to GitHub.

    Generate SDK package

Configure SDK Deployment Settings

The following information needs to be provided to deploy SDKs:

  1. Credential required to deploy an SDK to GitHub. This credential must have permission to create and update repositories.

  2. Package Configurations that include metadata such as the name of the package, a brief description of what it does, its Authors etc.

APIMatic aggregates this information into an entity called a Publishing Profile.

Create Reusable Configurations for Deploying the SDKs to GitHub

Create a Publishing Profile

Follow the steps listed below to create a Publishing Profile:

  • Provide a descriptive name for your Publishing Profile and click Save & Next.

    Create a new publishing profile

  • Provide General Information about your SDK Packages and click Save & Next. The information you provide here will be used to pre-populate metadata about each programming language you want to deploy SDKs for.

    General information about publishing profile

  • If you only wish to publish the SDK Source to GitHub, you can Disable Package Publishing to skip publishing to a Package Registry at this point. Review the Source Code Settings for each language.You can skip any languages that you do not want to publish; you will be able to set these up later. Some fields will be pre-filled based on the General Information you provided in the previous step. You will also need to provide Credentials for GitHub. More on Github Credentials in the next section. General information about publishing profile Setup SDK source settings

  • Click Save to save these configurations.

Create Github Credential

  • To create a Credential, navigate to the Credentials menu item from the sidebar and select git.

Credentials menu

  • Click the Add Credential button and follow the provided instructions to create the required gitHub credential.

Create new  credentials

Deploy SDKs

After providing all the Package settings, you are ready to Deploy your SDKs.

  • Select a Publishing Profile to use for publishing the SDKs. If you just set up a Profile, it will be pre-selected for you. Next, provide a Package Version for your SDK that follows the semantic version format MAJOR.MINOR.PATCH e.g. 1.0.1. This version number will be used to create a tag in your GitHub repository. You can either provide a single version for all SDKs or a separate version for each. After providing Package Versions, click on Publish Packages and Source Code to initiate the Deployment process. Publish SDK for API

  • Deployment can take a few minutes. You can track the status of each individual SDK while it is being deployed. The status is updated dynamically as publishing progresses.

    Track publishing status

  • After Deployment completes, the status of all initiated deployment attempts will be updated to reflect either success or failure.

    SDK publishing completed

  • If SDK Deployment is successful, you will be able to see the Deployed SDK Package on Github by clicking the Source button in the Actions column. The Actions column also contains a Logs button which will allow you to view the Deployment Logs listing the commands that were executed to Deploy your SDKs along with their output.

View deployed SDK on GitHub