Skip to content

Commit

Permalink
feat: update to go-github/v64
Browse files Browse the repository at this point in the history
  • Loading branch information
isometry committed Sep 10, 2024
1 parent 78e162b commit 3057f2e
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 89 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
go-version: "1.20"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
18 changes: 12 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
version: 2
before:
hooks:
- go mod tidy
builds:
- env:
- main: .
binary: ghup
env:
- CGO_ENABLED=0
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- "-s -w -X github.com/nexthink-oss/ghup/cmd.buildVersion={{.Version}} -X github.com/nexthink-oss/ghup/cmd.buildCommit={{.ShortCommit}} -X github.com/nexthink-oss/ghup/cmd.buildDate={{.Date}}"
- >-
-s -w
-X github.com/nexthink-oss/ghup/cmd.version={{.Version}}
-X github.com/nexthink-oss/ghup/cmd.commit={{.ShortCommit}}
-X github.com/nexthink-oss/ghup/cmd.date={{.Date}}
goos:
- freebsd
- windows
Expand All @@ -19,12 +26,11 @@ builds:
- "386"
- arm
- arm64
binary: ghup
archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
snapshot:
name_template: "{{ .Tag }}-next"
version_template: "{{ .Tag }}-next"
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256
Expand All @@ -37,11 +43,11 @@ changelog:
- "^docs:"
- "^test:"
brews:
- tap:
- repository:
owner: isometry
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
folder: Formula
directory: Formula
description: A GitHub API client for managing tags and repository content from third-party automation systems
homepage: https://just.breathe.io/project/ghup/
test: |
Expand Down
2 changes: 2 additions & 0 deletions cmd/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func init() {
contentCmd.Flags().StringSliceP("delete", "d", []string{}, "file-path to delete")
viper.BindPFlag("delete", contentCmd.Flags().Lookup("delete"))

contentCmd.Flags().SortFlags = false

rootCmd.AddCommand(contentCmd)
}

Expand Down
10 changes: 6 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
)

var (
buildVersion string = "snapshot"
buildCommit string = "unknown"
buildDate string = "unknown"
version string = "snapshot"
commit string = "unknown"
date string = "unknown"

localRepo *local.Repository
defaultUserName string
Expand All @@ -37,7 +37,7 @@ var rootCmd = &cobra.Command{
Use: "ghup",
Short: "Update GitHub content and tags via API",
SilenceUsage: true,
Version: fmt.Sprintf("%s-%s (built %s)", buildVersion, buildCommit, buildDate),
Version: fmt.Sprintf("%s-%s (built %s)", version, commit, date),
}

// Execute adds all child commands to the root command and sets flags appropriately.
Expand Down Expand Up @@ -99,6 +99,8 @@ func init() {

rootCmd.PersistentFlags().BoolVarP(&force, "force", "f", false, "force action")
viper.BindPFlag("force", rootCmd.PersistentFlags().Lookup("force"))

rootCmd.Flags().SortFlags = false
}

// initViper initializes Viper to load config from the environment
Expand Down
4 changes: 3 additions & 1 deletion cmd/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"

"github.com/apex/log"
"github.com/google/go-github/v50/github"
"github.com/google/go-github/v64/github"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -32,6 +32,8 @@ func init() {
tagCmd.Flags().Bool("lightweight", false, "force lightweight tag")
viper.BindPFlag("lightweight", tagCmd.Flags().Lookup("lightweight"))

tagCmd.Flags().SortFlags = false

rootCmd.AddCommand(tagCmd)
}

Expand Down
45 changes: 22 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
module github.com/nexthink-oss/ghup

go 1.19
go 1.22.0

toolchain go1.23.1

require (
github.com/apex/log v1.9.0
github.com/go-git/go-git/v5 v5.12.0
github.com/google/go-github/v50 v50.2.0
github.com/google/go-github/v64 v64.0.0
github.com/pkg/errors v0.9.1
github.com/shurcooL/githubv4 v0.0.0-20230424031643-6cea62ecd5a9
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/whilp/git-urls v1.0.0
Expand All @@ -16,13 +18,13 @@ require (
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.0.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/cloudflare/circl v1.4.0 // indirect
github.com/cyphar/filepath-securejoin v0.3.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
Expand All @@ -34,30 +36,27 @@ require (
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect
github.com/skeema/knownhosts v1.2.2 // indirect
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 // indirect
github.com/skeema/knownhosts v1.3.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading

0 comments on commit 3057f2e

Please sign in to comment.