# README
Uploading Release Assets to Github
To upload release assets to Github, follow these steps (requires go-utils 0.2.10+).
Create a Go script
Create a script upload_github_release_asset.go
, like this:
package main
import (
"github.com/solo-io/go-utils/githubutils"
)
func main() {
assets := make([]githubutils.ReleaseAssetSpec, 2)
assets[0] = githubutils.ReleaseAssetSpec{
Name: "hello",
ParentPath: "_output",
UploadSHA: true,
}
assets[1] = githubutils.ReleaseAssetSpec{
Name: "my-resource.yaml",
ParentPath: "namespace",
}
spec := githubutils.UploadReleaseAssetSpec{
Owner: "solo-io",
Repo: "testrepo",
Assets: assets,
SkipAlreadyExists: true,
}
githubutils.UploadReleaseAssetCli(&spec)
}
Create a Make target
#----------------------------------------------------------------------------------
# Github Assets
#----------------------------------------------------------------------------------
.PHONY: upload-github-release-assets
upload-github-release-assets: hello
go run upload_github_release_assets.go
Update cloudbuild.yaml to call this target
steps:
- name: 'gcr.io/solo-corp/go-mod-make:0.1.1'
args: [..., 'upload-github-release-assets', ...]
secretEnv: ['GITHUB_TOKEN']
env:
- 'TAGGED_VERSION=$TAG_NAME'
Make sure GITHUB_TOKEN
and TAGGED_VERSION
are in the environment.
Notes
- On each asset, a flag
UploadSHA
can be set to true to upload a SHA256 hash file. - Set
SkipAlreadyExists=true
to not fail when trying to upload an asset that already exists.
# Packages
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
This function writes directly to a writer, so the user is required to close the writer manually.
Filters slice of github releases by providing a constraint on the release semver does not modify input slice, returns the filtered list.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Gets all issues from a repo in order from newest to oldest.
Gets all issues from a repo in order from newest to oldest, up to a maxIssues number of issues.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Sorts github release array in place by semver, from most recent release to least (v2.8.0, v1.7.0, v1.6.0...).
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
https://docs.github.com/en/rest/guides/traversing-with-pagination#changing-the-number-of-items-received.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author
No description provided by the author