# Fern Autorelease

> Automate SDK releases with Fern Autorelease. Detects API spec changes, regenerates SDKs, determines version bumps, and publishes to package registries.

Fern Autorelease automates SDK releases end-to-end. When your API specification changes, Autorelease regenerates SDKs, determines the version bump, and publishes to package registries.

## How it works

Autorelease detects changes to your spec using either **git-based detection** (monitors your spec repository for commits) or **pull-based detection** (periodically fetches your hosted spec from a URL). Once changes are detected, Autorelease:

1. Regenerates SDKs for all configured languages
2. Analyzes the API diff and determines the next version (semantic, calendar-based, integer, or custom)
3. Commits to repositories, tags releases, and publishes packages
4. Updates changelogs automatically

Autorelease pauses and requests confirmation if it's uncertain about the version bump. Publishing uses tokens stored in your GitHub Actions secrets—Fern never has access to these credentials.

If a release fails, Autorelease pauses and sends alerts via Slack (if configured) or the Fern Dashboard where you can review and retry.

## Setup

To enable Autorelease, add `autorelease: true` to your `generators.yml` and ensure the [Fern GitHub App](https://github.com/apps/fern-api) is installed on your SDK repositories. Releases trigger automatically on commits to your spec repository and appear as commit status checks. No changes to your CI/CD setup are required.

<Tabs>
  <Tab title="Enable globally for all generators">
    ```yaml generators.yml
    autorelease: true
    ```
  </Tab>

  <Tab title="Enable per-generator">
    ```yaml generators.yml {6}
    groups:
      python-sdk:
        generators:
          - name: fernapi/fern-python-sdk
            version: 4.50.1
            autorelease: true
    ```
  </Tab>
</Tabs>

<Frame>
  <img src="https://files.buildwithfern.com/fern.docs.buildwithfern.com/learn/4fb6d6f1e8c713d5accb06cf0a684a90aac9a01d511bc1558ed7b02cc0adf460/products/sdks/images/autorelease-commit-check.png" alt="Autorelease commit status check" />
</Frame>

### Customize Autorelease

You can customize Autorelease if you need to fetch from a hosted spec URL or review releases before publishing.

<AccordionGroup>
  <Accordion title="Enable pull-based detection">
    Add a cron schedule to your `generators.yml`:

    ```yaml generators.yml
    autorelease:
      cron:
        schedule: "0 0 * * 0"  # Weekly on Sunday at midnight
    ```

    Or configure per-generator:

    ```yaml generators.yml
    groups:
      python-sdk:
        generators:
          - name: fernapi/fern-python-sdk
            version: 4.50.1
            autorelease:
              cron:
                schedule: "0 */6 * * *"  # Every 6 hours
    ```
  </Accordion>

  <Accordion title="Review releases before publishing">
    [Set `mode: pull-request`](/learn/sdks/reference/generators-yml#pull-request) to review releases before publishing.  Autorelease will open a pull request for you to review instead of publishing directly.

    ```yaml generators.yml {8}
    groups: 
      ts-sdk:
        generators:
          - name: fernapi/fern-typescript-sdk
          ...
            github: 
              repository: your-org/your-repo-name
              mode: pull-request
    ```
  </Accordion>
</AccordionGroup>