Add go-publish sub-action for publishing Go modules to Fly#44
Conversation
sverdlov93
left a comment
There was a problem hiding this comment.
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):
-
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. -
Copyright year —
go-publish.tsandgo-publish.spec.tssay(2025), should be(2026). -
Integration test dependency — PR body notes "requires fly-client >= 1.3.0". Since fly-desktop#185 is merged, confirm the client release includes the
publishcommand before merging this.
LGTM.
Overview
Adds a new
go-publishcomposite action and supporting code for publishing Go modules to JFrog Fly's Go registry directly from GitHub Actions workflows.This is the
fly-actioncounterpart to thefly publish goCLI 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>]viaexecFlyCLI, using the authentication context established by the parentjfrog/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"]What's included
go-publish/action.yml— sub-action definition withpathandversioninputssrc/go-publish.ts— action entry point that calls the CLI and processes resultssrc/go-publish.spec.ts— unit tests (11 test cases covering success, error, version, and auth scenarios)src/constants.ts— newCLI_CMD_PUBLISHandINPUT_PATHconstantspackage.json— added esbuild entry forlib/go-publish.jsgo-publish-integrationjob in CI that creates a test module, publishes it, and verifies it's downloadable viago mod downloadPublish commanddescribe block with help, flags, and error validation testsNotes
GONOSUMDB/GONOSUMCHECKconfigured since privately published modules aren't onsum.golang.org. The fly CLI prints this hint after a successful publish.publishcommand). They will pass once fly-desktop#185 is released.