diff --git a/fern/products/sdks/overview/go/assets/go-package.png b/fern/products/sdks/overview/go/assets/go-package.png new file mode 100644 index 000000000..3e4061978 Binary files /dev/null and b/fern/products/sdks/overview/go/assets/go-package.png differ diff --git a/fern/products/sdks/overview/go/publishing-to-go-package-manager.mdx b/fern/products/sdks/overview/go/publishing-to-go-package-manager.mdx index 36378dde1..b3367f0c6 100644 --- a/fern/products/sdks/overview/go/publishing-to-go-package-manager.mdx +++ b/fern/products/sdks/overview/go/publishing-to-go-package-manager.mdx @@ -1,9 +1,111 @@ --- -title: Publishing to Go Package Manager -description: How to publish the Fern Go SDK to NPM. +title: Publishing to Pkgsite +description: How to publish the Fern Go SDK to Pkgsite. --- -Learn how to publish your Fern Go SDK to the NPM registry. +Publish your public-facing Fern GO SDK to the [Pkgsite +registry](https://pkg.go.dev/). After following the steps on this page, +you'll have a versioned package published on Pkgsite. -This page is a WIP, please refer to our previous [documentation](https://buildwithfern.com/learn/sdks/guides/publish-a-public-facing-sdk). + + Versioned package published on Pkgsite + +This guide assumes that you already have an initialized `fern` folder on your local machine. If you don’t, run `fern init`. See [Go Quickstart](quickstart.mdx) for more details. + + +## Set up your GitHub integration + + 1. Create a new GitHub repository called `company-go` (or something similar) for your SDK, if you haven't done so already. Make sure your repository has: + * **Public** visibility + * A required license (e.g. [MIT](https://opensource.org/license/mit), [Apache](https://www.apache.org/licenses/LICENSE-2.0)) to the repository. + 1. Install the [Fern GitHub App](https://github.com/apps/fern-api): Select **Configure**, then scroll down to **Repository Access**. Select **Only select repositories** and in the dropdown select the repository for your SDK. Click **Save**. + + +## Configure `generators.yml` + + + + + + Navigate to your `generators.yml` on your local machine. Your `generators.yml` lives inside of your `fern` folder and contains all the configuration for your Fern generators. + + Add a new generator to `generators.yml`: + + + ```bash + fern add fern-go-sdk --group go-sdk + ``` + + Once the command completes, you'll see a new group created in your `generators.yml`: + + ```yaml {2-11} + groups: + go-sdk: + generators: + - name: fernapi/fern-go-sdk + version: + output: + location: local-file-system + path: ../sdks/go + config: + module: + path: sdk + ``` + + + + + + Go publishes via Git repositories, so remove the auto-generated + `output` and `config` properties. Instead, add the path to your + GitHub repository: + + ```yaml {6-7} + groups: + go-sdk: + generators: + - name: fernapi/fern-go-sdk + version: + github: + repository: devalog/company-go + + ``` + + + + + +## Release your SDK to Pkgsite + + At this point, you're ready to generate a release for your SDK. + + + + + + Regenerate your SDK and publish it on PyPI: + + ```bash + fern generate --group go-sdk --version + ``` + Local machine output will verify that the release is pushed to your + repository and tagged with the version you specified. + + + + + + Navigate to `https://pkg.go.dev/github.com///` and send a request to index your package. In a few minutes, your new release should be published to [https://pkg.go.dev/](https://pkg.go.dev/)! + + After releasing a new version, it may take a few minutes for Pkgsite + to index and display the update. You can also try checking to see if the Go + proxy has indexed your module at + `https://proxy.golang.org/github.com///@v/list`. Pkgsite + indexing usually happens within 5-15 min of the proxy picking it up. For + more information, see Go's documentation on [Adding a + package](https://pkg.go.dev/about#adding-a-package). + + + +