forked from flyteorg/flyte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release workflow added (flyteorg#170)
* release workflow added * run ci pipeline * lint fix
- Loading branch information
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v.*.*.*' | ||
|
||
jobs: | ||
release-cli: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.bump-version.outputs.tag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
project_name: kubectl-flyte | ||
before: | ||
hooks: | ||
- go mod download | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
main: ./cmd/kubectl-flyte/main.go | ||
binary: kubectl-flyte | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
ldflags: | ||
- -s -w -X github.com/lyft/flytepropeller/version.Version={{.Version}} -X github.com/lyft/flytepropeller/version.Build={{.ShortCommit}} -X github.com/lyft/flytepropeller/version.BuildTime={{.Date}} | ||
archives: | ||
- replacements: | ||
386: i386 | ||
amd64: x86_64 | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
scoop: | ||
# Default is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}" | ||
# url_template: "http://github.mycompany.com/foo/bar/releases/{{ .Tag }}/{{ .ArtifactName }}" | ||
|
||
# Repository to push the app manifest to. | ||
bucket: | ||
owner: lyft | ||
name: flytepropeller | ||
|
||
# Git author used to commit to the repository. | ||
# Defaults are shown. | ||
commit_author: | ||
name: goreleaserbot | ||
email: [email protected] | ||
|
||
# Your app's homepage. | ||
# Default is empty. | ||
homepage: "https://godoc.org/github.com/lyft/flytepropeller" | ||
|
||
# Your app's description. | ||
# Default is empty. | ||
description: "kubectl-flyte is an command line tool that can be used as an extension to kubectl" | ||
|
||
# Your app's license | ||
# Default is empty. | ||
license: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package version | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
// This module provides the ability to inject Build (git sha) and Version information at compile time. | ||
// To set these values invoke go build as follows | ||
// go build -ldflags “-X github.com/lyft/flytepropeller/version.Build=xyz -X github.com/lyft/flytepropeller/version.Version=1.2.3" | ||
// will provide the build and version information | ||
var ( | ||
// Specifies the GIT sha of the build | ||
Build = "unknown" | ||
// Version for the build, should follow a semver | ||
Version = "unknown" | ||
// Build timestamp | ||
BuildTime = time.Now().String() | ||
) | ||
|
||
// LogBuildInformation Use this method to log the build information for the current app. The app name should be provided. To inject the build | ||
// and version information refer to the top-level comment in this file | ||
func LogBuildInformation(appName string) { | ||
logrus.Info("------------------------------------------------------------------------") | ||
logrus.Infof("App [%s], Version [%s], BuildSHA [%s], BuildTS [%s]", appName, Version, Build, BuildTime) | ||
logrus.Info("------------------------------------------------------------------------") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package version | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"testing" | ||
"time" | ||
|
||
"github.com/magiconair/properties/assert" | ||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
type dFormat struct { | ||
} | ||
|
||
func (dFormat) Format(e *logrus.Entry) ([]byte, error) { | ||
return []byte(e.Message), nil | ||
} | ||
|
||
func TestLogBuildInformation(t *testing.T) { | ||
|
||
n := time.Now() | ||
BuildTime = n.String() | ||
buf := bytes.NewBufferString("") | ||
logrus.SetFormatter(dFormat{}) | ||
logrus.SetOutput(buf) | ||
LogBuildInformation("hello") | ||
assert.Equal(t, buf.String(), fmt.Sprintf("------------------------------------------------------------------------App [hello], Version [unknown], BuildSHA [unknown], BuildTS [%s]------------------------------------------------------------------------", n.String())) | ||
} |