Skip to content

Add go-publish sub-action for publishing Go modules to Fly#44

Merged
yahavi merged 10 commits intomainfrom
feature/go-publish
Apr 16, 2026
Merged

Add go-publish sub-action for publishing Go modules to Fly#44
yahavi merged 10 commits intomainfrom
feature/go-publish

Conversation

@yahavi
Copy link
Copy Markdown
Member

@yahavi yahavi commented Apr 15, 2026

Overview

Adds a new go-publish composite action and supporting code for publishing Go modules to JFrog Fly's Go registry directly from GitHub Actions workflows.

This is the fly-action counterpart to the fly publish go CLI command added in fly-desktop#185. The action wraps the CLI command in a GitHub Action interface with inputs for module path and version, making it easy to publish Go modules from CI.

How it works

The go-publish/ sub-action accepts two optional inputs:

  • path — path to the Go module directory (defaults to repo root)
  • version — explicit module version (auto-detected from git tags if omitted)

Under the hood it calls fly publish go <path> [--version <version>] via execFlyCLI, using the authentication context established by the parent jfrog/fly-action. Results are output as a JSON array of per-module statuses.

flowchart LR
    A["jfrog/fly-action"] -->|"auth context"| B["jfrog/fly-action/go-publish"]
    B -->|"fly publish go"| C["Fly Go Registry"]
Loading

What's included

  • go-publish/action.yml — sub-action definition with path and version inputs
  • src/go-publish.ts — action entry point that calls the CLI and processes results
  • src/go-publish.spec.ts — unit tests (11 test cases covering success, error, version, and auth scenarios)
  • src/constants.ts — new CLI_CMD_PUBLISH and INPUT_PATH constants
  • package.json — added esbuild entry for lib/go-publish.js
  • Integration test job — new go-publish-integration job in CI that creates a test module, publishes it, and verifies it's downloadable via go mod download
  • Integration test specs — new Publish command describe block with help, flags, and error validation tests
  • README — new Go Publish section with usage example, inputs table, and GONOSUMCHECK guidance for consumers

Notes

  • Consumers of published modules need GONOSUMDB/GONOSUMCHECK configured since privately published modules aren't on sum.golang.org. The fly CLI prints this hint after a successful publish.
  • Integration tests require fly-client >= 1.3.0 (with publish command). They will pass once fly-desktop#185 is released.

@yahavi yahavi added the new feature Automatically generated release notes label Apr 15, 2026
@yahavi yahavi self-assigned this Apr 15, 2026
Copy link
Copy Markdown
Collaborator

@sverdlov93 sverdlov93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid sub-action — follows the upload/download pattern exactly, comprehensive unit tests (11 cases), and the integration test is well-designed with unique versioning via github.run_id and full round-trip verification (publish + download with GONOSUMDB/GONOSUMCHECK).

Minor items (not blocking):

  1. No cleanup of test artifacts — each CI run publishes example.com/ci/test-module@v0.0.1-ci.{runId} permanently. These accumulate over time. Consider a periodic cleanup job or a post-step that deletes the test module.

  2. Copyright yeargo-publish.ts and go-publish.spec.ts say (2025), should be (2026).

  3. Integration test dependency — PR body notes "requires fly-client >= 1.3.0". Since fly-desktop#185 is merged, confirm the client release includes the publish command before merging this.

LGTM.

@yahavi yahavi merged commit 351c506 into main Apr 16, 2026
7 of 8 checks passed
@yahavi yahavi deleted the feature/go-publish branch April 17, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants