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
25 changes: 25 additions & 0 deletions examples/typescript-sdk/generators.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This file configures all of your SDKs. It should be located at:
# your-parent-repo/fern/generators.yml.
default-group: local
groups:
local:
generators:
- name: fernapi/fern-typescript-sdk
output:
location: local-file-system
path: ../sdks/typescript
version: 2.6.4
# This group configures a TypeScript SDK for npm publishing
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
version: 2.6.4
output:
location: npm
package-name: your-unique-package-name
token: ${NPM_TOKEN}
config:
namespaceExport: YourClientName
github:
repository: your-company/ts-sdk
# generator groups for other SDKs go here
32 changes: 32 additions & 0 deletions examples/typescript-sdk/typescript-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Add this file as: your-parent-repo/.github/workflows/typescript-publish.yml
# This workflow should be in the same repository as your generators.yml, which
# should point to the repository containing your TypeScript SDK code.

name: Publish TypeScript SDK

on:
# Manually trigger a release from the GitHub UI. Triggering this workflow kicks
# off the npm publishing process from your TypeScript SDK repository.
workflow_dispatch:
inputs:
version:
description: "The version of the TypeScript SDK that you would like to release"
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install Fern CLI
run: npm install -g fern-api

- name: Release TypeScript SDK
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
fern generate --group ts-sdk --version ${{ inputs.version }} --log-level debug
3 changes: 2 additions & 1 deletion fern/products/sdks/github-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Fern recommends a parent-child repository structure containing:

```bash
├─ company-repo # Parent repository
│ ├─ .github.workflows # Contains publishing workflows for all SDKs
│ └─ fern/
│ ├─ fern.config.json # Root-level config
│ ├─ generators.yml # References child repos
Expand Down Expand Up @@ -89,7 +90,7 @@ Each SDK has its own repository with the following structure:

```bash
typescript-sdk-repo/ # Individual SDK repository
├─ .github/workflows/ # Publishing workflows
├─ .github/workflows/ # Generated by Fern
├─ scripts/
├─ src/
├─ tests/
Expand Down
Loading