Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 18 additions & 38 deletions fern/products/sdks/autorelease.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ description: Automate SDK releases with Fern Autorelease. Detects API spec chang
<Markdown src="/snippets/agent-directive.mdx"/>

<Note title="Early Access">
Fern Autorelease is currently in early access. [Contact us](https://buildwithfern.com/contact) to get started.
Fern Autorelease is in early access. [Contact us](https://buildwithfern.com/contact) to get started.
</Note>

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:
When changes to your API specification are committed, Autorelease:

1. Regenerates SDKs for all configured languages
2. Analyzes the API diff and determines the next version (semantic, calendar-based, integer, or custom)
2. Analyzes the API diff and determines the appropriate [semantic version](https://semver.org/) bump
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
Expand Down Expand Up @@ -55,38 +53,9 @@ groups:
/>
</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: <Markdown src="/snippets/version-number-python.mdx"/>
autorelease:
cron:
schedule: "0 */6 * * *" # Every 6 hours
```
</Accordion>

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

```yaml generators.yml {8}
groups:
Expand All @@ -98,5 +67,16 @@ groups:
repository: your-org/your-repo-name
mode: pull-request
```
</Accordion>
</AccordionGroup>

### Disable autorelease

To disable Autorelease for a specific generator while keeping it enabled globally, set `autorelease: false` on that generator:

```yaml generators.yml {6}
groups:
internal-sdk:
generators:
- name: fernapi/fern-python-sdk
version: <Markdown src="/snippets/version-number-python.mdx"/>
autorelease: false
```
41 changes: 3 additions & 38 deletions fern/products/sdks/reference/generators-yml-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -403,25 +403,10 @@ Enable or disable [Fern Autorelease](/learn/sdks/overview/autorelease) globally
autorelease: true
```

<ParamField path="autorelease" type="boolean | object" default={false} required={false} toc={true}>
Set to `true` to enable Autorelease, `false` to disable it. Explicit configuration in `generators.yml` takes precedence over other enablement methods. [Per-generator settings](#autorelease-2) override this global configuration.
<ParamField path="autorelease" type="boolean" default={false} required={false} toc={true}>
Set to `true` to enable Autorelease, `false` to disable it. [Per-generator settings](#autorelease-2) override this global configuration.
</ParamField>

<Accordion title="Enable with pull-based detection">

Configure a cron schedule to periodically fetch and check for spec changes:

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

<ParamField path="cron.schedule" type="string" required={true} toc={true}>
A cron expression defining how often to check for spec changes. Uses standard cron syntax.
</ParamField>
</Accordion>

## `aliases`

Define shortcuts that map to multiple generator groups, allowing you to run several groups with a single command. When you run `fern generate --group <alias>`, all groups in the alias run in parallel. You can also set an alias as your `default-group`.
Expand Down Expand Up @@ -1011,30 +996,10 @@ groups:
autorelease: true
```

<ParamField path="autorelease" type="boolean | object" default={false} required={false} toc={true}>
<ParamField path="autorelease" type="boolean" default={false} required={false} toc={true}>
Set to `true` to enable Autorelease for this generator, `false` to disable it. Per-generator settings override the global [`autorelease`](#autorelease-1) configuration.
</ParamField>

<Accordion title="Enable with pull-based detection">

Configure a cron schedule to periodically fetch and check for spec changes for this generator:

```yml title="generators.yml" {6-8}
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
...
autorelease:
cron:
schedule: "0 */6 * * *" # Every 6 hours
```

<ParamField path="cron.schedule" type="string" required={true} toc={true}>
A cron expression defining how often to check for spec changes. Uses standard cron syntax.
</ParamField>
</Accordion>

#### `snippets`

Configures snippets for a particular generator.
Expand Down
Loading