rename executable, add goreleaser

This commit is contained in:
Samuel Lorch 2021-09-09 15:29:34 +02:00
parent ecbb7c88cd
commit 78d3c80b28
7 changed files with 88 additions and 6 deletions

View file

@ -17,13 +17,13 @@ jobs:
go-version: 1.17 go-version: 1.17
- name: Build - name: Build
run: go build run: go build -o passbolt
- name: Update Wiki - name: Update Wiki
run: | run: |
mkdir doc mkdir doc
ls ls
./go-passbolt-cli gendoc ./passbolt gendoc
- name: Upload Documentation to Wiki - name: Upload Documentation to Wiki
uses: SwiftDocOrg/github-wiki-publish-action@v1 uses: SwiftDocOrg/github-wiki-publish-action@v1

33
.github/workflows/.release.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: goreleaser
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

49
.goreleaser.yml Normal file
View file

@ -0,0 +1,49 @@
project_name: go-passbolt-cli
builds:
- env: [CGO_ENABLED=0]
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
binary: passbolt
hooks:
post: |
./passbolt completion bash > bash-completion
./passbolt completion zsh > zsh-completion
./passbolt completion fish > fish-completion
mkdir man
./passbolt gendoc --type man
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
release:
draft: true
header: |
## Release {{ .Tag }} - ({{ .Date }})
nfpms:
- maintainer: Samuel Lorch <sam@lorch.net>
description: A CLI for Passbolt.
homepage: https://github.com/speatzle/go-passbolt-cli
license: MIT
contents:
- src: bash-completion
dst: /usr/share/bash-completion/completions/passbolt
- src: zsh-completion
dst: /usr/share/zsh/site-functions/_passbolt
- src: fish-completion
dst: /usr/share/fish/vendor_completions.d/passbolt.fish
- src: man/*
dst: /usr/share/man/man1/
recommends:
- bash_completion
formats:
- deb
- rpm
- apk

View file

@ -25,7 +25,7 @@ You can then list all users:
```bash ```bash
go-passbolt-cli list user go-passbolt-cli list user
``` ```
For Sharing well need to know how we want to share, for that there are these Permission Types: For sharing we will need to know how we want to share, for that there are these Permission Types:
| Code | Meaning | | Code | Meaning |
| --- | --- | | --- | --- |

View file

@ -12,7 +12,7 @@ var configureCmd = &cobra.Command{
Use: "configure", Use: "configure",
Short: "Configure saves the provided global flags to the Config File", Short: "Configure saves the provided global flags to the Config File",
Long: `Configure saves the provided global flags to the Config File. Long: `Configure saves the provided global flags to the Config File.
this makes using the cli easier as they don't have to be specifed all the time.`, this makes using the cli easier as they don't have to be specified all the time.`,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
if viper.ConfigFileUsed() == "" { if viper.ConfigFileUsed() == "" {

View file

@ -15,7 +15,7 @@ var cfgFile string
// rootCmd represents the base command when called without any subcommands // rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "go-passbolt-cli", Use: "passbolt",
Short: "A CLI tool to interact with Passbolt.", Short: "A CLI tool to interact with Passbolt.",
Long: `A CLI tool to interact with Passbolt.`, Long: `A CLI tool to interact with Passbolt.`,
} }

View file

@ -23,7 +23,7 @@ var ResourceListCmd = &cobra.Command{
} }
func init() { func init() {
ResourceListCmd.Flags().Bool("favorite", false, "Resources that are maked as favorite") ResourceListCmd.Flags().Bool("favorite", false, "Resources that are marked as favorite")
ResourceListCmd.Flags().Bool("own", false, "Resources that are owned by me") ResourceListCmd.Flags().Bool("own", false, "Resources that are owned by me")
ResourceListCmd.Flags().StringArrayP("group", "g", []string{}, "Resources that are shared with group") ResourceListCmd.Flags().StringArrayP("group", "g", []string{}, "Resources that are shared with group")