Skip to content

Latest commit

 

History

History
85 lines (60 loc) · 2.88 KB

File metadata and controls

85 lines (60 loc) · 2.88 KB

🌿 setup-cli

A GitHub Action that installs the Fern CLI in your workflow — so you can generate SDKs and docs on every push.

Requirements

Node.js and npm must be available before this action runs. Add actions/setup-node as a prior step if your runner doesn't include them by default.

Usage

Pin to the floating major version (e.g. @setup-cli/v1) to automatically receive the latest updates:

- uses: actions/setup-node@v4
  with:
    node-version: "lts/*"

- name: Setup Fern CLI
  uses: fern-api/actions@setup-cli/v1

With a specific version

- name: Setup Fern CLI
  uses: fern-api/actions@setup-cli/v1
  with:
    version: "3.81.0"

Inputs

Input Description Default
version Fern CLI version to install (latest or semver) latest

Example workflow

name: Generate SDKs

on:
  push:
    branches: [main]

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: "lts/*"

      - name: Setup Fern CLI
        uses: fern-api/actions@setup-cli/v1

      - run: fern generate

Releasing

Dispatch .github/workflows/release.yml in the fern-api/actions monorepo (action: setup-cli, version: v1.0.1). The workflow builds the bundle, publishes it to the root of dist/setup-cli, creates the tag setup-cli/v1.0.1, and moves the floating setup-cli/v1 major alias so consumers pinned to @setup-cli/v1 get the update immediately. See CONTRIBUTING.md for details.