github.wit

 1interface github {
 2    /// A GitHub release.
 3    record github-release {
 4        /// The version of the release.
 5        version: string,
 6        /// The list of assets attached to the release.
 7        assets: list<github-release-asset>,
 8    }
 9
10    /// An asset from a GitHub release.
11    record github-release-asset {
12        /// The name of the asset.
13        name: string,
14        /// The download URL for the asset.
15        download-url: string,
16    }
17
18    /// The options used to filter down GitHub releases.
19    record github-release-options {
20        /// Whether releases without assets should be included.
21        require-assets: bool,
22        /// Whether pre-releases should be included.
23        pre-release: bool,
24    }
25
26    /// Returns the latest release for the given GitHub repository.
27    latest-github-release: func(repo: string, options: github-release-options) -> result<github-release, string>;
28
29    /// Returns the GitHub release with the specified tag name for the given GitHub repository.
30    ///
31    /// Returns an error if a release with the given tag name does not exist.
32    github-release-by-tag-name: func(repo: string, tag: string) -> result<github-release, string>;
33}