From bdef20a6dfce230c416d020a5734990666d7cf6c Mon Sep 17 00:00:00 2001 From: giuseppe-g-gelardi Date: Mon, 20 Nov 2023 09:04:34 -0500 Subject: [PATCH 1/2] add goreleaser, update config filename --- .gitignore | 7 +++++++ .goreleaser.yaml | 51 +++++++++++++++++++++++++++++++++++++++++++++++ config/cfg_yml.go | 2 +- go.sum | 4 ---- 4 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 .goreleaser.yaml diff --git a/.gitignore b/.gitignore index 93c3bca..bc3951a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,10 @@ go.work .deprecated config.yaml NOTES.md + +dist/ + +# env file +.env +.env.* +!.env.example diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..574b2eb --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,51 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 +project_name: git-sessionizer +before: + hooks: + # You may remove this if you don't use go modules. + - go mod tidy + # you may remove this if you don't need go generate + # - go generate ./... + +builds: + - id: "{{ .ProjectName }}-{{ .Version }}" + main: ./cmd/session/ + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + id: gs + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + use: github + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + diff --git a/config/cfg_yml.go b/config/cfg_yml.go index 865e480..cc71230 100644 --- a/config/cfg_yml.go +++ b/config/cfg_yml.go @@ -30,7 +30,7 @@ type CfgManager struct { func NewCfgManager() *CfgManager { return &CfgManager{ - ConfigFileName: "config.yaml", + ConfigFileName: "session_config.yaml", DefaultConfig: Config{ AccessToken: "", Editor: "vscode", diff --git a/go.sum b/go.sum index 779916d..11ffced 100644 --- a/go.sum +++ b/go.sum @@ -13,7 +13,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= @@ -24,7 +23,6 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= @@ -42,12 +40,10 @@ github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKt github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos= From c526c70e425a1aac7cf6f06ca1d43724a4041bef Mon Sep 17 00:00:00 2001 From: giuseppe-g-gelardi Date: Mon, 20 Nov 2023 09:05:21 -0500 Subject: [PATCH 2/2] revert workflow go.yml --- .github/workflows/go.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a497708..eee7dae 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,21 +24,5 @@ jobs: - name: Download dependencies run: go mod download - # - name: Build - # run: go build -v ./cmd/session - - name: Build - run: go build -v -o session ./cmd/session - - - name: Install - run: mv session /usr/local/bin/session - - # - name: Install - # run: | - # go install -v -trimpath -ldflags="-s -w" ./cmd/session - # mv $GOPATH/bin/session /usr/local/bin/session - - - name: Display Go version and installed binary path - run: | - go version - echo /usr/local/bin/session + run: go build -v ./cmd/session