Skip to content

nx-release-publish executor

The nx-release-publish executor publishes a Go module to the Go proxy (proxy.golang.org) by running GOPROXY=proxy.golang.org go list -m <module>@<version>. The version is resolved from the latest git tag matching the release tag pattern configured in nx.json.

The manifest key in executors.json is release-publish. The inferred target name is nx-release-publish.

nx nx-release-publish my-go-lib

Or through the Nx release pipeline:

nx release --publish
Option Type Default Description
moduleRoot string - Path to the directory containing the go.mod file. Defaults to the project root.
dryRun boolean false Whether to perform a dry run (no actual publishing)

The NX_DRY_RUN environment variable also triggers a dry run when set to true.

Inferred for all Go projects (applications and libraries), with moduleRoot resolved to the project’s root path (e.g. libs/my-go-lib):

{
  "executor": "@naxodev/gonx:release-publish",
  "options": {
    "moduleRoot": "libs/my-go-lib"
  },
  "configurations": {
    "development": {
      "dryRun": true
    }
  }
}

The development configuration sets dryRun: true, allowing test runs via --configuration=development.

The default release tag pattern is v{version}. Override it in nx.json under release.releaseTag.pattern, which supports {projectName} and {version} placeholders.