-
Notifications
You must be signed in to change notification settings - Fork 8
goreleaser and build cmd #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fcb96e3
goreleaser and build cmd
az-smartling c9b5b6e
Merge branch 'master' into goreleaser_and_build_cmd
az-smartling 3a1c475
updated goreleaser
az-smartling 0ab6695
CR changes
az-smartling 0a2af8c
checksums
az-smartling 5a1797d
CGO_ENABLED=0
az-smartling 654e363
used nfpms
az-smartling 2f54098
CR changes
az-smartling File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,48 @@ | ||
| version: 2 | ||
|
|
||
| project_name: smartling-cli | ||
| dist: bin | ||
|
|
||
| release: | ||
| name_template: "Version {{.Version}}" | ||
| disable: true | ||
| github: | ||
| owner: Smartling | ||
| name: smartling-cli | ||
|
|
||
| builds: | ||
| - | ||
| binary: smartling-cli | ||
|
|
||
| goos: | ||
| - linux | ||
| - darwin | ||
| - windows | ||
|
|
||
| goarch: | ||
| - amd64 | ||
| - arm64 | ||
| - arm | ||
|
|
||
| ignore: | ||
| - goos: darwin | ||
| goarch: arm | ||
| - goos: windows | ||
| goarch: arm | ||
|
|
||
| flags: | ||
| - -trimpath | ||
|
|
||
| ldflags: | ||
| - -s -w | ||
| - -X github.com/Smartling/smartling-cli/cmd/helpers/build.CommitID={{ .FullCommit }} | ||
| - -X github.com/Smartling/smartling-cli/cmd/helpers/build.Date={{ .Date }} | ||
| - -X github.com/Smartling/smartling-cli/cmd/helpers/build.GoVersion={{ .Env.SMARTLING_CLI_GOVERSION }} | ||
| - -X github.com/Smartling/smartling-cli/cmd/helpers/build.Platform={{ .Env.SMARTLING_CLI_PLATFORM }} | ||
|
|
||
| archives: | ||
| - formats: [binary] | ||
| name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
|
|
||
| checksum: | ||
| disable: true | ||
|
az-smartling marked this conversation as resolved.
Outdated
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,21 @@ | ||
| package build | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/Smartling/smartling-cli/cmd/helpers/build" | ||
|
|
||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| // NewBuildCmd creates a new build command. | ||
| func NewBuildCmd() *cobra.Command { | ||
| buildCmd := &cobra.Command{ | ||
| Use: "build", | ||
| Short: "Print the build information", | ||
| Run: func(_ *cobra.Command, _ []string) { | ||
| fmt.Println(build.String()) | ||
| }, | ||
| } | ||
| return buildCmd | ||
| } |
This file contains hidden or 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
This file contains hidden or 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,42 @@ | ||
| package build | ||
|
|
||
| import ( | ||
| "fmt" | ||
| ) | ||
|
|
||
| // These variables will be set via ldflags at build time. | ||
| var ( | ||
| // CliVersion is version information | ||
| CliVersion = "3.2" | ||
| // CommitID is the git commit hash | ||
| CommitID = "" | ||
| // Date is date of binary built | ||
| Date = "" | ||
| // BuiltBy is into about builder | ||
| BuiltBy = "GoReleaser" | ||
| // GoVersion is Go version | ||
| GoVersion = "" | ||
| // Platform is platform | ||
| Platform = "" | ||
| ) | ||
|
|
||
| // String returns the version information as a formatted string. | ||
| func String() string { | ||
| return fmt.Sprintf(` | ||
| Smartling-cli is a library and CLI tool for managing Smartling projects. | ||
|
|
||
| Version: %s | ||
| GitCommit: %s | ||
| BuildDate: %s | ||
| BuiltBy: %s | ||
| GoVersion: %s | ||
| Platform: %s | ||
| `, | ||
|
az-smartling marked this conversation as resolved.
|
||
| CliVersion, | ||
| CommitID, | ||
| Date, | ||
| BuiltBy, | ||
| GoVersion, | ||
| Platform, | ||
| ) | ||
| } | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.