In Development Package, API may change between versions.

import "github.com/egdaemon/eg/runtime/x/wasi/eggithub"

func DownloadURL

func DownloadURL(pattern string) string

generate the github download url

func Draft

func Draft(patterns ...string) eg.OpFn

Draft creates (or reuses) a draft release for PatternVersion and uploads the given patterns to it. Does not verify or publish the release — pair with Promote to publish once all expected assets have been uploaded. for local environments `eg compute local` auto-detects a GitHub token via `gh auth token` when the repository's remote is github.com and the gh cli is installed. override it explicitly with e.g.) eg compute local -e GH_TOKEN=<token>, needed for environments without gh.

func PatternVersion

func PatternVersion() string

provides the version pattern based on a github commit. provides sequentially incrementing versions based on the commit dates. assuming you're generating commits on merge this will always move forward.

func Promote

func Promote(patterns ...string) eg.OpFn

Promote a draft release to a full release, this is very experimental. uses PatternVersion to determine which draft release to promote, and verifies that every pattern is already present in the release's asset listing before publishing it. for local environments `eg compute local` auto-detects a GitHub token via `gh auth token` when the repository's remote is github.com and the gh cli is installed. override it explicitly with e.g.) eg compute local -e GH_TOKEN=<token>, needed for environments without gh.

func Release

func Release(patterns ...string) eg.OpFn

Release to github, this is very experimental. for local environments `eg compute local` auto-detects a GitHub token via `gh auth token` when the repository's remote is github.com and the gh cli is installed. override it explicitly with e.g.) eg compute local -e GH_TOKEN=<token>, needed for environments without gh.

func Upload

func Upload(release string, patterns ...string) eg.OpFn

Upload an asset to a github release, this is very experimental. uploads into whatever release currently exists for the given version (typically a draft created by Draft), and does not publish it. for local environments `eg compute local` auto-detects a GitHub token via `gh auth token` when the repository's remote is github.com and the gh cli is installed. override it explicitly with e.g.) eg compute local -e GH_TOKEN=<token>, needed for environments without gh. Usage:

eggithub.Upload(eggithub.PatternVersion(), "foo.txt", "bar.txt")

func UploadRuntime

func UploadRuntime(rt shell.Command, release string, patterns ...string) eg.OpFn