Help us shape the future of Go! Take the 2026 Go Developer Survey

publish

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package publish hands a built mod to a provider: hyperline.gg, an archive players unpack and run, or a GitHub release that holds the archive.

Index

Constants

View Source
const DefaultOrigin = "https://hyperline.gg"

DefaultOrigin is the service modlock publish uses by default.

Variables

This section is empty.

Functions

func Archive

func Archive(ctx context.Context, mod *Mod, version, dir string) (string, error)

Archive writes a zip players unpack and run on Windows: Play.cmd, the command line of release version, and mod under mod/, in one folder named for the mod. It returns the archive's path in dir.

func GitHub

func GitHub(ctx context.Context, dir, tag, archive, notes string, output io.Writer) error

GitHub attaches archive to the release tagged tag in the GitHub repository of the project in dir, creating the release with notes when it does not exist. It runs the gh command line, which holds the creator's GitHub sign-in.

func WindowsCommand

func WindowsCommand(ctx context.Context, version string) (string, error)

WindowsCommand returns the Windows command line of release version: this executable on Windows, or the release's copy, downloaded into the user cache the first time.

Types

type Hyperline

type Hyperline struct {
	// Origin is the service, such as DefaultOrigin.
	Origin string
	// SessionFile holds the saved sign-in, readable only by the creator.
	SessionFile string
	// Output receives the sign-in instructions.
	Output io.Writer
}

Hyperline publishes to hyperline.gg or another service with its API.

func (*Hyperline) Publish

func (h *Hyperline) Publish(ctx context.Context, mod *Mod) (*publish.Release, error)

Publish uploads mod with its notes and returns the release the service recorded. It signs in through the browser when no saved session is valid.

type Mod

type Mod struct {
	// Dir is the built mod's directory.
	Dir string
	// Manifest is its mod.json.
	Manifest *wasm.Manifest
	// Notes say what the release changed, for providers that show them.
	Notes string
}

Mod is a checked built mod.

func (*Mod) Files

func (m *Mod) Files() []string

Files lists the files a release holds: the manifest, the entry and the map files the mod ships, if any. Other files in the directory, such as a session's log, stay out.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL