From 0de5a9bca9c47c8ddf9833c2918f24f263cc0ede Mon Sep 17 00:00:00 2001 From: Songmu Date: Tue, 29 Jan 2019 17:38:37 +0900 Subject: [PATCH 01/13] adjust Makefile --- Makefile | 2 +- go.sum | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b1b5bd7..48c3503 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ build: deps $(GO) build -ldflags=$(BUILD_LDFLAGS) ./cmd/ghg crossbuild: devel-deps - goxz -pv=v$(shell gobump show -r) -build-ldflags=$(BUILD_LDFLAGS) \ + env GO111MODULE=on goxz -pv=v$(shell gobump show -r) -build-ldflags=$(BUILD_LDFLAGS) \ -os=linux,darwin,windows,freebsd -arch=amd64 -d=./dist/v$(shell gobump show -r) \ ./cmd/ghg diff --git a/go.sum b/go.sum index eee38ad..50979c6 100644 --- a/go.sum +++ b/go.sum @@ -5,9 +5,11 @@ github.com/Songmu/ghch v0.4.0 h1:vjUSVUzQv8Ory8Racnl6GRYtgXAjV0r4WNtK2+NxAz8= github.com/Songmu/ghch v0.4.0/go.mod h1:5qBopb83Q3Uon5zMOHlM4dHimM2yqBKtDC6x3+OX48E= github.com/Songmu/gitsemvers v0.0.1 h1:KjekOA6kEuKW20b9Ws3j9El2rqQSFNkuOQdYUZMbDNo= github.com/Songmu/gitsemvers v0.0.1/go.mod h1:3Pz60HfJXd/t1WPctJ/4TNwP/j0vwQQz4dnjI8Bgf3U= +github.com/Songmu/goxz v0.1.1 h1:Mtwfo7UYe6CHGiixyIk/2PCsyDZEQ/o7e/O7lLsScZg= github.com/Songmu/goxz v0.1.1/go.mod h1:nmwtXnff39nrvYo3eu3es2OigsPCIIDl2EAw+k5Icyc= github.com/Songmu/retry v0.1.0 h1:hPA5xybQsksLR/ry/+t/7cFajPW+dqjmjhzZhioBILA= github.com/Songmu/retry v0.1.0/go.mod h1:7sXIW7eseB9fq0FUvigRcQMVLR9tuHI0Scok+rkpAuA= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 h1:eX+pdPPlD279OWgdx7f6KqIRSONuK7egk+jDx7OM3Ac= github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76/go.mod h1:KjxHHirfLaw19iGT70HvVjHQsL1vq1SRQB4yOsAfy2s= @@ -35,6 +37,7 @@ github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRU github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/goveralls v0.0.2 h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU= @@ -45,6 +48,7 @@ github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9 h1:Y94YB7jrsi github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e h1:Qa6dnn8DlasdXRnacluu8HzPts0S1I9zvvUPDbBnXFI= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM= +github.com/motemen/gobump v0.0.0-20170609005736-b5563e1d8b75 h1:u86Q2ngUdcfDmyFxHoQXMVdxpsOZpLJCjZ7b5izUrEQ= github.com/motemen/gobump v0.0.0-20170609005736-b5563e1d8b75/go.mod h1:bJBHskFfPJ5RT+ERdz949lt6jPVTKl2v3KjIbbeQx/A= github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae h1:UF9xsJn7AeQ72TCus3eRO1lh08Id3AoF37vl+qigL/w= github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= @@ -54,9 +58,11 @@ github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 h1:sL8IwvC3aR github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64/go.mod h1:2u3khcAsOOTW3hlaM3dbJxDdvwHMDGQsC5m7edPSLkg= github.com/pierrec/lz4 v2.0.3+incompatible h1:h0ipQUMRrnr+/HHhxhceftyXk4QcZsmxSNliSG75Bi0= github.com/pierrec/lz4 v2.0.3+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.0.0-20180311214515-816c9085562c h1:F5RoIh7F9wB47PvXvpP1+Ihq1TkyC8iRdvwfKkESEZQ= github.com/pkg/errors v0.0.0-20180311214515-816c9085562c/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/tcnksm/ghr v0.12.0 h1:3dbJOU5/Nr6C1HeBWwOIvMsVt4/eOg2EQDAg11H0Y0Y= github.com/tcnksm/ghr v0.12.0/go.mod h1:2YSVCxP2GsVRnE6R3bZxEiVnpJ9GUkotqlq2No0kTMU= @@ -82,5 +88,6 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20181001222327-b71db7f417f1 h1:iRyLwL55h8bRuPzrG1NCD/YhCtjruK3cJnx0R8RK+M8= golang.org/x/tools v0.0.0-20181001222327-b71db7f417f1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= From 215f055b4fa5e8f43de9d0405057874006d5acd4 Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 16:36:30 +0900 Subject: [PATCH 02/13] update release related stuffs --- .github/actions/action.yml | 22 +++++++++++ .github/workflows/release.yaml | 14 +++++++ .github/workflows/reviewdog.yaml | 42 +++++++++++++++++++++ .github/workflows/tagpr.yaml | 25 +++++++++++++ .github/workflows/test.yaml | 28 ++++++++++++++ .gitignore | 3 +- .travis.yml | 10 ----- Makefile | 63 +++++++++++++++----------------- README.md | 6 +-- _tools/releng | 12 ------ codecov.yml | 2 + go.mod | 2 + 12 files changed, 168 insertions(+), 61 deletions(-) create mode 100644 .github/actions/action.yml create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/reviewdog.yaml create mode 100644 .github/workflows/tagpr.yaml create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml delete mode 100755 _tools/releng create mode 100644 codecov.yml diff --git a/.github/actions/action.yml b/.github/actions/action.yml new file mode 100644 index 0000000..a8ffd51 --- /dev/null +++ b/.github/actions/action.yml @@ -0,0 +1,22 @@ +name: release +description: release ghg +inputs: + tag: + description: tag name to be released + default: '' + token: + description: GitHub token + required: true +runs: + using: composite + steps: + - name: setup go + uses: actions/setup-go@v3 + with: + go-version: 1.x + - name: release + run: | + make crossbuild upload + shell: bash + env: + GITHUB_TOKEN: ${{ inputs.token }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..084f9b1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,14 @@ +name: release +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - uses: ./.github/actions/release + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/reviewdog.yaml b/.github/workflows/reviewdog.yaml new file mode 100644 index 0000000..67b90ea --- /dev/null +++ b/.github/workflows/reviewdog.yaml @@ -0,0 +1,42 @@ +name: reviewdog +on: [pull_request] + +jobs: + staticcheck: + name: staticcheck + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: staticcheck + uses: reviewdog/action-staticcheck@v1 + with: + reporter: github-pr-review + level: warning + + misspell: + name: misspell + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: misspell + uses: reviewdog/action-misspell@v1 + with: + reporter: github-pr-review + level: warning + locale: "US" + + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + - uses: reviewdog/action-actionlint@v1 + with: + reporter: github-pr-review diff --git a/.github/workflows/tagpr.yaml b/.github/workflows/tagpr.yaml new file mode 100644 index 0000000..74af334 --- /dev/null +++ b/.github/workflows/tagpr.yaml @@ -0,0 +1,25 @@ +name: tagpr +on: + push: + branches: + - "main" +jobs: + tagpr: + runs-on: ubuntu-latest + steps: + - name: setup go + uses: actions/setup-go@v3 + with: + go-version: 1.x + - name: checkout + uses: actions/checkout@v3 + - name: tagpr + id: tagpr + uses: Songmu/tagpr@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: ./.github/actions/release + with: + tag: ${{ steps.tagpr.outputs.tag }} + token: ${{ secrets.GITHUB_TOKEN }} + if: "steps.tagpr.outputs.tag != ''" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..df160a9 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,28 @@ +name: test +on: + push: + branches: + - "**" +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + steps: + - name: checkout + uses: actions/checkout@v3 + - name: setup go + uses: actions/setup-go@v3 + with: + go-version-file: go.mod + - name: test + run: go test -coverprofile coverage.out -covermode atomic ./... + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + - name: Send coverage + uses: codecov/codecov-action@v1 diff --git a/.gitignore b/.gitignore index 913e987..a858de4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .* !.gitignore -!.travis.yml -!.goxc.json +!.github dist/ vendor/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d832680..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go -go: -- 1.11.x -script: -- make lint -- make test -after_script: -- make cover -env: - secure: H29U/4imp1ceHRKLnV9YRQpsLhqa0CwLEL50wamjMDBJ07A6m7B50knRNnPbDYBa3maJ6Xbj55UgDWWnVjLpO9HW3WGb4/qnK5/8OQl6XduNRDtol0QmKw8/wC8C0iB0o1DFWv6dIdaQ5DN4fDSM5521QzVvqrQiNBQh4siD3xt4XW6aqTOz9FYWO5HTqGDcxlrNTqeMZHmoSOS3+uQ9thXW3zrN1Lz+C0AHnz+V40/DwfXm35mbJ+B3uFRfxtVZ/FyN+K4xwmhmJEco/gAd6+RQOBkNIwlmorOItND+GLYFaNIWK9y0iNeOUkmswQQP4IKKWtLwK78tTaX6jOQUkVHdzlbh6mZx2XRqKIgovct841JPFqAqNyW/UYJBxEbEMJ9/4SBEV2+/IVo9WKRSRX+WxEyQqWQCEclSUudTK3V5KdX4AeLy5X/ZYO5rHJt5Xk3WvDJW+7ozozDGXLMlJxi8G4wDgxG8lBX0OVf7xI5nnsfZFUyVpLYID6W3TUbmPOm6A4Mfdj3j4uE0/IeY2A+8rtTu1dqiEn5H1aT8CDoYoJM5vokYlcvYh9PYeAiSRVaz1SUMtWZZRfsbRaJS1qMgw+dWhXssJUNNyoeoSQR/YIlBrRIyrpZp1oeiacsXK4G2jFL7jx9zTWm6bPV0C8etBjIj3mfl7QrCX4XFOnE= diff --git a/Makefile b/Makefile index 48c3503..5a875b2 100644 --- a/Makefile +++ b/Makefile @@ -1,48 +1,43 @@ -VERSION = $(shell gobump show -r) +VERSION = $(shell godzil show-version) CURRENT_REVISION = $(shell git rev-parse --short HEAD) -BUILD_LDFLAGS = "-X github.com/Songmu/ghg.revision=$(CURRENT_REVISION)" +BUILD_LDFLAGS = "-s -w -X github.com/Songmu/ghg.revision=$(CURRENT_REVISION)" ifdef update u=-u endif -GO ?= GO111MODULE=on go - +.PHONY: deps deps: - env GO111MODULE=on go mod download - -devel-deps: deps - $(GO) get ${u} \ - golang.org/x/lint/golint \ - github.com/mattn/goveralls \ - github.com/motemen/gobump/cmd/gobump \ - github.com/Songmu/goxz/cmd/goxz \ - github.com/Songmu/ghch/cmd/ghch \ - github.com/tcnksm/ghr - -test: deps - $(GO) test + go get ${u} -d + go mod tidy -lint: devel-deps - $(GO) vet - golint -set_exit_status +.PHONY: devel-deps +devel-deps: + go install github.com/tcnksm/ghr@latest + go install github.com/Songmu/godzil/cmd/godzil@latest -cover: devel-deps - goveralls +.PHONY: test +test: + go test +.PHONY: build build: deps - $(GO) build -ldflags=$(BUILD_LDFLAGS) ./cmd/ghg + go build -ldflags=$(BUILD_LDFLAGS) ./cmd/ghg -crossbuild: devel-deps - env GO111MODULE=on goxz -pv=v$(shell gobump show -r) -build-ldflags=$(BUILD_LDFLAGS) \ - -os=linux,darwin,windows,freebsd -arch=amd64 -d=./dist/v$(shell gobump show -r) \ - ./cmd/ghg +.PHONY: install +install: + go install -ldflags=$(BUILD_LDFLAGS) ./cmd/ghg -bump: devel-deps - _tools/releng +CREDITS: go.sum devel-deps + godzil credits -w -upload: - ghr v$(VERSION) dist/v$(VERSION) - -release: bump crossbuild upload +DIST_DIR = dist +.PHONY: crossbuild +crossbuild: go.sum devel-deps + rm -rf $(DIST_DIR) + godzil crossbuild -pv=v$(VERSION) -build-ldflags=$(BUILD_LDFLAGS) \ + -os=linux,darwin,windows,freebsd -d=$(DIST_DIR) ./cmd/* + cd $(DIST_DIR) && shasum -a 256 $$(find * -type f -maxdepth 0) > SHA256SUMS -.PHONY: deps devel-deps test lint cover build crossbuild build upload release +.PHONY: upload +upload: + ghr v$(VERSION) $(DIST_DIR) diff --git a/README.md b/README.md index be678d5..b0b43b8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ ghg ======= -[![Build Status](https://travis-ci.org/Songmu/ghg.png?branch=master)][travis] +[![Build Status](https://travis-ci.org/Songmu/ghg.png?branch=main)][travis] [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license] [![GoDoc](https://godoc.org/github.com/Songmu/ghg?status.svg)][godoc] [travis]: https://travis-ci.org/Songmu/ghg -[coveralls]: https://coveralls.io/r/Songmu/ghg?branch=master -[license]: https://github.com/Songmu/ghg/blob/master/LICENSE +[coveralls]: https://coveralls.io/r/Songmu/ghg?branch=main +[license]: https://github.com/Songmu/ghg/blob/main/LICENSE [godoc]: https://godoc.org/github.com/Songmu/ghg ## Description diff --git a/_tools/releng b/_tools/releng deleted file mode 100755 index b8866b7..0000000 --- a/_tools/releng +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -set -e - -echo current version: $(gobump show -r) -read -p "input next version: " next_version - -gobump set $next_version -w -ghch -w -N v$next_version - -git ci -am "Checking in changes prior to tagging of version v$next_version" -git tag v$next_version -git push && git push --tags diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..cd96b59 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +comment: false +github_checks: false diff --git a/go.mod b/go.mod index ad70df7..6d25e80 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module github.com/Songmu/ghg +go 1.19 + require ( github.com/Songmu/ghch v0.4.0 // indirect github.com/Songmu/retry v0.1.0 // indirect From 9deb9c74d0afb430d1270cb20a4f118020f48c35 Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 16:38:13 +0900 Subject: [PATCH 03/13] go mod tidy --- go.mod | 35 ++++++++++------------ go.sum | 92 ++++++++++++++++++++-------------------------------------- 2 files changed, 47 insertions(+), 80 deletions(-) diff --git a/go.mod b/go.mod index 6d25e80..e545123 100644 --- a/go.mod +++ b/go.mod @@ -3,30 +3,27 @@ module github.com/Songmu/ghg go 1.19 require ( - github.com/Songmu/ghch v0.4.0 // indirect - github.com/Songmu/retry v0.1.0 // indirect - github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 - github.com/fhs/go-netrc v1.0.0 - github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db - github.com/google/go-github v17.0.0+incompatible // indirect - github.com/google/go-querystring v1.0.0 // indirect - github.com/hashicorp/go-version v1.1.0 // indirect github.com/jessevdk/go-flags v1.4.0 - github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6 - github.com/jtacoma/uritemplates v1.0.0 - github.com/mattn/go-colorable v0.0.9 // indirect - github.com/mattn/go-isatty v0.0.4 // indirect github.com/mholt/archiver v3.1.1+incompatible - github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286 // indirect github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9 github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e - github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 - github.com/pierrec/lz4 v2.0.5+incompatible github.com/pkg/errors v0.8.0 - github.com/tcnksm/ghr v0.12.0 // indirect github.com/tcnksm/go-gitconfig v0.1.2 - github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e // indirect - github.com/ulikunitz/xz v0.5.4 - golang.org/x/oauth2 v0.0.0-20190115181402-5dab4167f31c // indirect +) + +require ( + github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect + github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 // indirect + github.com/fhs/go-netrc v1.0.0 // indirect + github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect + github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6 // indirect + github.com/jtacoma/uritemplates v1.0.0 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae // indirect + github.com/onsi/gomega v1.24.2 // indirect + github.com/pierrec/lz4 v2.0.5+incompatible // indirect + github.com/stretchr/testify v1.8.1 // indirect + github.com/ulikunitz/xz v0.5.4 // indirect + github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect ) diff --git a/go.sum b/go.sum index 50979c6..562638a 100644 --- a/go.sum +++ b/go.sum @@ -1,93 +1,63 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/Masterminds/semver v1.4.2 h1:WBLTQ37jOCzSLtXNdoo8bNM8876KhNqOKvrlGITgsTc= -github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Songmu/ghch v0.4.0 h1:vjUSVUzQv8Ory8Racnl6GRYtgXAjV0r4WNtK2+NxAz8= -github.com/Songmu/ghch v0.4.0/go.mod h1:5qBopb83Q3Uon5zMOHlM4dHimM2yqBKtDC6x3+OX48E= -github.com/Songmu/gitsemvers v0.0.1 h1:KjekOA6kEuKW20b9Ws3j9El2rqQSFNkuOQdYUZMbDNo= -github.com/Songmu/gitsemvers v0.0.1/go.mod h1:3Pz60HfJXd/t1WPctJ/4TNwP/j0vwQQz4dnjI8Bgf3U= -github.com/Songmu/goxz v0.1.1 h1:Mtwfo7UYe6CHGiixyIk/2PCsyDZEQ/o7e/O7lLsScZg= -github.com/Songmu/goxz v0.1.1/go.mod h1:nmwtXnff39nrvYo3eu3es2OigsPCIIDl2EAw+k5Icyc= -github.com/Songmu/retry v0.1.0 h1:hPA5xybQsksLR/ry/+t/7cFajPW+dqjmjhzZhioBILA= -github.com/Songmu/retry v0.1.0/go.mod h1:7sXIW7eseB9fq0FUvigRcQMVLR9tuHI0Scok+rkpAuA= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 h1:eX+pdPPlD279OWgdx7f6KqIRSONuK7egk+jDx7OM3Ac= github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76/go.mod h1:KjxHHirfLaw19iGT70HvVjHQsL1vq1SRQB4yOsAfy2s= github.com/fhs/go-netrc v1.0.0 h1:jbXXfpcwkeNHq5lXXXQO9DTWD7wUqWxgnyPKUe5H4I0= github.com/fhs/go-netrc v1.0.0/go.mod h1:tGgE+SHFQhgo1jg+hG6/uCxBJv5Pnq7pTMjvaEWrOu8= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/jessevdk/go-flags v0.0.0-20180331124232-1c38ed7ad0cc h1:0L2sGkaj6MWuV1BfXsrLJ/+XA8RzKKVsYlLVXNkK1Lw= -github.com/jessevdk/go-flags v0.0.0-20180331124232-1c38ed7ad0cc/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6 h1:2RMaSBb+6kdtJtT7SZfx4OtcjEuRQpAZ9UFU9OiT1BQ= github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6/go.mod h1:cp3HFHBb/V8Qd4OUxZ8kz8lhwN3HKkMgKFhyM7H5+q4= github.com/jtacoma/uritemplates v1.0.0 h1:xwx5sBF7pPAb0Uj8lDC1Q/aBPpOFyQza7OC705ZlLCo= github.com/jtacoma/uritemplates v1.0.0/go.mod h1:IhIICdE9OcvgUnGwTtJxgBQ+VrTrti5PcbLVSJianO8= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/goveralls v0.0.2 h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/mholt/archiver v0.0.0-20180417220235-e4ef56d48eb0/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU= github.com/mholt/archiver v3.1.1+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= -github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286 h1:KHyL+3mQOF9sPfs26lsefckcFNDcIZtiACQiECzIUkw= -github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9 h1:Y94YB7jrsihrbGSqRNMwRWJ2/dCxr0hdC2oPRohkx0A= github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e h1:Qa6dnn8DlasdXRnacluu8HzPts0S1I9zvvUPDbBnXFI= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM= -github.com/motemen/gobump v0.0.0-20170609005736-b5563e1d8b75 h1:u86Q2ngUdcfDmyFxHoQXMVdxpsOZpLJCjZ7b5izUrEQ= -github.com/motemen/gobump v0.0.0-20170609005736-b5563e1d8b75/go.mod h1:bJBHskFfPJ5RT+ERdz949lt6jPVTKl2v3KjIbbeQx/A= github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae h1:UF9xsJn7AeQ72TCus3eRO1lh08Id3AoF37vl+qigL/w= github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= -github.com/octokit/go-octokit v0.0.0-20160312003706-812e91dfbd64 h1:OwOU33Drn5nnaK4RHjDcMuEn6BvZuG6qob/o1L36A+g= -github.com/octokit/go-octokit v0.0.0-20160312003706-812e91dfbd64/go.mod h1:2u3khcAsOOTW3hlaM3dbJxDdvwHMDGQsC5m7edPSLkg= github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 h1:sL8IwvC3aR6zDCqGxiwwHS6YCIvz2njaSqAORFeGqm8= github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64/go.mod h1:2u3khcAsOOTW3hlaM3dbJxDdvwHMDGQsC5m7edPSLkg= -github.com/pierrec/lz4 v2.0.3+incompatible h1:h0ipQUMRrnr+/HHhxhceftyXk4QcZsmxSNliSG75Bi0= -github.com/pierrec/lz4 v2.0.3+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= +github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.0.0-20180311214515-816c9085562c h1:F5RoIh7F9wB47PvXvpP1+Ihq1TkyC8iRdvwfKkESEZQ= -github.com/pkg/errors v0.0.0-20180311214515-816c9085562c/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/tcnksm/ghr v0.12.0 h1:3dbJOU5/Nr6C1HeBWwOIvMsVt4/eOg2EQDAg11H0Y0Y= -github.com/tcnksm/ghr v0.12.0/go.mod h1:2YSVCxP2GsVRnE6R3bZxEiVnpJ9GUkotqlq2No0kTMU= -github.com/tcnksm/go-gitconfig v0.0.0-20150505151006-6411ba19847f h1:99nosetRYX8rwJV837jA2kS+jWuY9UjSBbG4N2fpvDs= -github.com/tcnksm/go-gitconfig v0.0.0-20150505151006-6411ba19847f/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE= +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/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw= github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE= -github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e h1:IWllFTiDjjLIf2oeKxpIUmtiDV5sn71VgeQgg6vcE7k= -github.com/tcnksm/go-latest v0.0.0-20170313132115-e3007ae9052e/go.mod h1:d7u6HkTYKSv5m6MCKkOQlHwaShTMl3HjqSGW3XtVhXM= github.com/ulikunitz/xz v0.5.4 h1:zATC2OoZ8H1TZll3FpbX+ikwmadbO699PE06cIkm9oU= github.com/ulikunitz/xz v0.5.4/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= -golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 h1:rJm0LuqUjoDhSk2zO9ISMSToQxGz7Os2jRiOL8AWu4c= -golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180926154720-4dfa2610cdf3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190115181402-5dab4167f31c h1:pcBdqVcrlT+A3i+tWsOROFONQyey9tisIQHI4xqVGLg= -golang.org/x/oauth2 v0.0.0-20190115181402-5dab4167f31c/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20181001222327-b71db7f417f1 h1:iRyLwL55h8bRuPzrG1NCD/YhCtjruK3cJnx0R8RK+M8= -golang.org/x/tools v0.0.0-20181001222327-b71db7f417f1/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 7a086e1723ee3addc43fa8c0c97a5be61a745a63 Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 16:45:01 +0900 Subject: [PATCH 04/13] update badges --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b0b43b8..6b26adb 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,13 @@ ghg [![Build Status](https://travis-ci.org/Songmu/ghg.png?branch=main)][travis] [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license] -[![GoDoc](https://godoc.org/github.com/Songmu/ghg?status.svg)][godoc] +[![Coverage Status](https://codecov.io/gh/Songmu/ghg/branch/main/graph/badge.svg)][codecov] +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Songmu/ghg)][PkgGoDev] [travis]: https://travis-ci.org/Songmu/ghg -[coveralls]: https://coveralls.io/r/Songmu/ghg?branch=main +[codecov]: https://codecov.io/gh/Songmu/ghg [license]: https://github.com/Songmu/ghg/blob/main/LICENSE -[godoc]: https://godoc.org/github.com/Songmu/ghg +[PkgGoDev]: https://pkg.go.dev/github.com/Songmu/ghg ## Description @@ -16,7 +17,7 @@ Get the executable from github releases ## Installation - % go get github.com/Songmu/ghg/cmd/ghg + % go install github.com/Songmu/ghg/cmd/ghg@latest Built binaries are available on gihub releases. From cbcb69a6886abb461b19091342b3353b3b3031ce Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 16:47:16 +0900 Subject: [PATCH 05/13] don't run test on windows on CI --- .github/workflows/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index df160a9..8c79f22 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,6 @@ jobs: os: - ubuntu-latest - macOS-latest - - windows-latest steps: - name: checkout uses: actions/checkout@v3 From 94af94778069e0a921bb4f0a204530aed4c074c2 Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 16:49:18 +0900 Subject: [PATCH 06/13] update deps --- go.mod | 19 ++++++++++--------- go.sum | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index e545123..124dde5 100644 --- a/go.mod +++ b/go.mod @@ -3,27 +3,28 @@ module github.com/Songmu/ghg go 1.19 require ( - github.com/jessevdk/go-flags v1.4.0 + github.com/jessevdk/go-flags v1.5.0 github.com/mholt/archiver v3.1.1+incompatible - github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9 + github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 - github.com/pkg/errors v0.8.0 + github.com/pkg/errors v0.9.1 github.com/tcnksm/go-gitconfig v0.1.2 ) require ( github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect - github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 // indirect + github.com/dsnet/compress v0.0.1 // indirect github.com/fhs/go-netrc v1.0.0 // indirect - github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect + github.com/frankban/quicktest v1.14.4 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6 // indirect github.com/jtacoma/uritemplates v1.0.0 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae // indirect + github.com/nwaples/rardecode v1.1.3 // indirect github.com/onsi/gomega v1.24.2 // indirect - github.com/pierrec/lz4 v2.0.5+incompatible // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/stretchr/testify v1.8.1 // indirect - github.com/ulikunitz/xz v0.5.4 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect + golang.org/x/sys v0.3.0 // indirect ) diff --git a/go.sum b/go.sum index 562638a..0fa73eb 100644 --- a/go.sum +++ b/go.sum @@ -4,40 +4,46 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76 h1:eX+pdPPlD279OWgdx7f6KqIRSONuK7egk+jDx7OM3Ac= -github.com/dsnet/compress v0.0.0-20171208185109-cc9eb1d7ad76/go.mod h1:KjxHHirfLaw19iGT70HvVjHQsL1vq1SRQB4yOsAfy2s= +github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= +github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= +github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/fhs/go-netrc v1.0.0 h1:jbXXfpcwkeNHq5lXXXQO9DTWD7wUqWxgnyPKUe5H4I0= github.com/fhs/go-netrc v1.0.0/go.mod h1:tGgE+SHFQhgo1jg+hG6/uCxBJv5Pnq7pTMjvaEWrOu8= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= +github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6 h1:2RMaSBb+6kdtJtT7SZfx4OtcjEuRQpAZ9UFU9OiT1BQ= github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6/go.mod h1:cp3HFHBb/V8Qd4OUxZ8kz8lhwN3HKkMgKFhyM7H5+q4= github.com/jtacoma/uritemplates v1.0.0 h1:xwx5sBF7pPAb0Uj8lDC1Q/aBPpOFyQza7OC705ZlLCo= github.com/jtacoma/uritemplates v1.0.0/go.mod h1:IhIICdE9OcvgUnGwTtJxgBQ+VrTrti5PcbLVSJianO8= +github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU= github.com/mholt/archiver v3.1.1+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= -github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9 h1:Y94YB7jrsihrbGSqRNMwRWJ2/dCxr0hdC2oPRohkx0A= -github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e h1:Qa6dnn8DlasdXRnacluu8HzPts0S1I9zvvUPDbBnXFI= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM= -github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae h1:UF9xsJn7AeQ72TCus3eRO1lh08Id3AoF37vl+qigL/w= -github.com/nwaples/rardecode v0.0.0-20171029023500-e06696f847ae/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc= +github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 h1:sL8IwvC3aR6zDCqGxiwwHS6YCIvz2njaSqAORFeGqm8= github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64/go.mod h1:2u3khcAsOOTW3hlaM3dbJxDdvwHMDGQsC5m7edPSLkg= github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= -github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= +github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= @@ -51,11 +57,15 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw= github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE= -github.com/ulikunitz/xz v0.5.4 h1:zATC2OoZ8H1TZll3FpbX+ikwmadbO699PE06cIkm9oU= -github.com/ulikunitz/xz v0.5.4/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From b98a4d3a12b5be160dba10ff34239813205bf0cf Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 16:55:33 +0900 Subject: [PATCH 07/13] use os.UserHomeDir instead of go-homedir --- cli.go | 3 +-- go.mod | 1 - go.sum | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cli.go b/cli.go index ef6dce5..679aaef 100644 --- a/cli.go +++ b/cli.go @@ -8,7 +8,6 @@ import ( "path/filepath" "github.com/jessevdk/go-flags" - "github.com/mitchellh/go-homedir" gitconfig "github.com/tcnksm/go-gitconfig" ) @@ -59,7 +58,7 @@ func ghgHome() (string, error) { if ghome != "" { return ghome, nil } - home, err := homedir.Dir() + home, err := os.UserHomeDir() if err != nil { return "", err } diff --git a/go.mod b/go.mod index 124dde5..2d13a77 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.19 require ( github.com/jessevdk/go-flags v1.5.0 github.com/mholt/archiver v3.1.1+incompatible - github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 0fa73eb..afd5ad4 100644 --- a/go.sum +++ b/go.sum @@ -29,8 +29,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mholt/archiver v3.1.1+incompatible h1:1dCVxuqs0dJseYEhi5pl7MYPH9zDa1wBi7mF09cbNkU= github.com/mholt/archiver v3.1.1+incompatible/go.mod h1:Dh2dOXnSdiLxRiPoVfIr/fI1TwETms9B8CTWfeh7ROU= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e h1:Qa6dnn8DlasdXRnacluu8HzPts0S1I9zvvUPDbBnXFI= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM= github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc= From 17b1e15b836a1953d6dd865ed1f486ec80367ed4 Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 19:54:05 +0900 Subject: [PATCH 08/13] migrate to go-github from octokit --- .gitignore | 1 + cli.go | 3 ++- ghg.go | 41 +++++++++++++++++++++-------------------- go.mod | 14 ++++++++------ go.sum | 53 ++++++++++++++++++++++++++++------------------------- 5 files changed, 60 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index a858de4..3650fcf 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ !.github dist/ vendor/ +ghg diff --git a/cli.go b/cli.go index 679aaef..1f79c90 100644 --- a/cli.go +++ b/cli.go @@ -1,6 +1,7 @@ package ghg import ( + "context" "fmt" "io" "log" @@ -33,7 +34,7 @@ func (g *getCommand) Execute(args []string) error { if err != nil { return err } - ghcli := getOctCli(getToken()) + ghcli := getOctCli(context.TODO(), getToken()) for _, target := range args { gh := &ghg{ ghgHome: gHome, diff --git a/ghg.go b/ghg.go index 1930a8a..a988025 100644 --- a/ghg.go +++ b/ghg.go @@ -1,12 +1,12 @@ package ghg import ( + "context" "fmt" "io" "io/ioutil" "log" "net/http" - "net/url" "os" "path" "path/filepath" @@ -14,24 +14,26 @@ import ( "runtime" "strings" + "github.com/google/go-github/v48/github" "github.com/mholt/archiver" "github.com/mitchellh/ioprogress" - "github.com/octokit/go-octokit/octokit" "github.com/pkg/errors" + "golang.org/x/oauth2" ) -func getOctCli(token string) *octokit.Client { - var auth octokit.AuthMethod +func getOctCli(ctx context.Context, token string) *github.Client { + var oauthClient *http.Client if token != "" { - auth = octokit.TokenAuth{AccessToken: token} + ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token}) + oauthClient = oauth2.NewClient(ctx, ts) } - return octokit.NewClient(auth) + return github.NewClient(oauthClient) } type ghg struct { ghgHome string target string - client *octokit.Client + client *github.Client upgrade bool } @@ -46,7 +48,6 @@ func (gh *ghg) getBinDir() string { return filepath.Join(gh.getGhgHome(), "bin") } -var releaseByTagURL = octokit.Hyperlink("repos/{owner}/{repo}/releases/tags/{tag}") var ( archiveReg = regexp.MustCompile(`\.(?:zip|tgz|tar\.gz)$`) anyExtReg = regexp.MustCompile(`\.[a-zA-Z0-9]+$`) @@ -59,28 +60,28 @@ func (gh *ghg) get() error { return errors.Wrap(err, "failed to resolve target") } log.Printf("fetch the GitHub release for %s\n", gh.target) - var url *url.URL + + ctx := context.Background() if tag == "" { - url, err = octokit.ReleasesLatestURL.Expand(octokit.M{"owner": owner, "repo": repo}) - } else { - url, err = releaseByTagURL.Expand(octokit.M{"owner": owner, "repo": repo, "tag": tag}) + rel, _, err := gh.client.Repositories.GetLatestRelease(ctx, owner, repo) + if err != nil { + return errors.Wrap(err, "failed to get latest tag") + } + tag = rel.GetTagName() } + + release, _, err := gh.client.Repositories.GetReleaseByTag(ctx, owner, repo, tag) if err != nil { - return errors.Wrap(err, "failed to build GitHub URL") - } - release, r := gh.client.Releases(url).Latest() - if r.HasError() { - return errors.Wrap(r.Err, "failed to fetch a release") + return errors.Wrap(err, "failed to fetch a release") } - tag = release.TagName goarch := runtime.GOARCH goos := runtime.GOOS var urls []string for _, asset := range release.Assets { - name := asset.Name + name := asset.GetName() if strings.Contains(name, goarch) && strings.Contains(name, goos) && (archiveReg.MatchString(name) || !anyExtReg.MatchString(name)) { - urls = append(urls, fmt.Sprintf("https://github.com/%s/%s/releases/download/%s/%s", owner, repo, tag, name)) + urls = append(urls, asset.GetBrowserDownloadURL()) } } if len(urls) < 1 { diff --git a/go.mod b/go.mod index 2d13a77..3dbb3b6 100644 --- a/go.mod +++ b/go.mod @@ -3,27 +3,29 @@ module github.com/Songmu/ghg go 1.19 require ( + github.com/google/go-github/v48 v48.2.0 github.com/jessevdk/go-flags v1.5.0 github.com/mholt/archiver v3.1.1+incompatible github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e - github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 github.com/pkg/errors v0.9.1 github.com/tcnksm/go-gitconfig v0.1.2 + golang.org/x/oauth2 v0.3.0 ) require ( - github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect github.com/dsnet/compress v0.0.1 // indirect - github.com/fhs/go-netrc v1.0.0 // indirect github.com/frankban/quicktest v1.14.4 // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6 // indirect - github.com/jtacoma/uritemplates v1.0.0 // indirect + github.com/google/go-querystring v1.1.0 // indirect github.com/nwaples/rardecode v1.1.3 // indirect github.com/onsi/gomega v1.24.2 // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect - github.com/stretchr/testify v1.8.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect + golang.org/x/crypto v0.4.0 // indirect + golang.org/x/net v0.4.0 // indirect golang.org/x/sys v0.3.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.1 // indirect ) diff --git a/go.sum b/go.sum index afd5ad4..6fbcf54 100644 --- a/go.sum +++ b/go.sum @@ -1,26 +1,25 @@ -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= -github.com/fhs/go-netrc v1.0.0 h1:jbXXfpcwkeNHq5lXXXQO9DTWD7wUqWxgnyPKUe5H4I0= -github.com/fhs/go-netrc v1.0.0/go.mod h1:tGgE+SHFQhgo1jg+hG6/uCxBJv5Pnq7pTMjvaEWrOu8= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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/google/go-github/v48 v48.2.0 h1:68puzySE6WqUY9KWmpOsDEQfDZsso98rT6pZcz9HqcE= +github.com/google/go-github/v48 v48.2.0/go.mod h1:dDlehKBDo850ZPvCTK0sEqTCVWcrGl2LcDiajkYi89Y= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6 h1:2RMaSBb+6kdtJtT7SZfx4OtcjEuRQpAZ9UFU9OiT1BQ= -github.com/jingweno/go-sawyer v0.0.0-20140729165055-1999ae5763d6/go.mod h1:cp3HFHBb/V8Qd4OUxZ8kz8lhwN3HKkMgKFhyM7H5+q4= -github.com/jtacoma/uritemplates v1.0.0 h1:xwx5sBF7pPAb0Uj8lDC1Q/aBPpOFyQza7OC705ZlLCo= -github.com/jtacoma/uritemplates v1.0.0/go.mod h1:IhIICdE9OcvgUnGwTtJxgBQ+VrTrti5PcbLVSJianO8= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -33,8 +32,6 @@ github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e h1:Qa6dnn8Dla github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM= github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc= github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= -github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64 h1:sL8IwvC3aR6zDCqGxiwwHS6YCIvz2njaSqAORFeGqm8= -github.com/octokit/go-octokit v0.4.1-0.20160312003706-812e91dfbd64/go.mod h1:2u3khcAsOOTW3hlaM3dbJxDdvwHMDGQsC5m7edPSLkg= github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= @@ -42,17 +39,8 @@ github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -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/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw= github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= @@ -60,12 +48,27 @@ github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= +golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From e135e9e4464d6d0a5e8961f3cd856e931e5e40fc Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 20:37:18 +0900 Subject: [PATCH 09/13] quess download url before requesting assets --- cli.go | 5 +++-- ghg.go | 46 +++++++++++++++++++++++++++++++++++----------- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/cli.go b/cli.go index 1f79c90..7acefbe 100644 --- a/cli.go +++ b/cli.go @@ -34,7 +34,8 @@ func (g *getCommand) Execute(args []string) error { if err != nil { return err } - ghcli := getOctCli(context.TODO(), getToken()) + ctx := context.TODO() + ghcli := getOctCli(ctx, getToken()) for _, target := range args { gh := &ghg{ ghgHome: gHome, @@ -42,7 +43,7 @@ func (g *getCommand) Execute(args []string) error { client: ghcli, upgrade: g.Upgrade, } - err := gh.get() + err := gh.get(ctx) if err != nil { return err } diff --git a/ghg.go b/ghg.go index a988025..c2ff889 100644 --- a/ghg.go +++ b/ghg.go @@ -54,14 +54,13 @@ var ( isWindows = runtime.GOOS == "windows" ) -func (gh *ghg) get() error { +func (gh *ghg) get(ctx context.Context) error { owner, repo, tag, err := getOwnerRepoAndTag(gh.target) if err != nil { return errors.Wrap(err, "failed to resolve target") } log.Printf("fetch the GitHub release for %s\n", gh.target) - ctx := context.Background() if tag == "" { rel, _, err := gh.client.Repositories.GetLatestRelease(ctx, owner, repo) if err != nil { @@ -70,18 +69,43 @@ func (gh *ghg) get() error { tag = rel.GetTagName() } - release, _, err := gh.client.Repositories.GetReleaseByTag(ctx, owner, repo, tag) - if err != nil { - return errors.Wrap(err, "failed to fetch a release") - } goarch := runtime.GOARCH goos := runtime.GOOS + format := "tar.gz" + if goos == "windows" || goos == "darwin" { + format = "zip" + } + url := fmt.Sprintf( + "https://github.com/%[1]s/%[2]s/releases/download/%[3]s/%[2]s_%[3]s_%[4]s_%[5]s.%[6]s", + owner, repo, tag, goos, goarch, format) + req, err := gh.client.NewRequest("HEAD", url, nil) + if err != nil { + return err + } + httpCli := gh.client.Client() + httpCli.CheckRedirect = func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + } + req = req.WithContext(ctx) + resp, err := httpCli.Do(req) + if err != nil { + return err + } + resp.Body.Close() var urls []string - for _, asset := range release.Assets { - name := asset.GetName() - if strings.Contains(name, goarch) && strings.Contains(name, goos) && - (archiveReg.MatchString(name) || !anyExtReg.MatchString(name)) { - urls = append(urls, asset.GetBrowserDownloadURL()) + if resp.StatusCode >= 200 && resp.StatusCode < 400 { + urls = append(urls, url) + } else { + release, _, err := gh.client.Repositories.GetReleaseByTag(ctx, owner, repo, tag) + if err != nil { + return errors.Wrap(err, "failed to fetch a release") + } + for _, asset := range release.Assets { + name := asset.GetName() + if strings.Contains(name, goarch) && strings.Contains(name, goos) && + (archiveReg.MatchString(name) || !anyExtReg.MatchString(name)) { + urls = append(urls, asset.GetBrowserDownloadURL()) + } } } if len(urls) < 1 { From 0e4253e7e5b2a1b41a10fee121da565dce5bf9d8 Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 21:23:22 +0900 Subject: [PATCH 10/13] detect latest tag without using API --- ghg.go | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/ghg.go b/ghg.go index c2ff889..e767a99 100644 --- a/ghg.go +++ b/ghg.go @@ -2,6 +2,7 @@ package ghg import ( "context" + "encoding/json" "fmt" "io" "io/ioutil" @@ -62,11 +63,35 @@ func (gh *ghg) get(ctx context.Context) error { log.Printf("fetch the GitHub release for %s\n", gh.target) if tag == "" { - rel, _, err := gh.client.Repositories.GetLatestRelease(ctx, owner, repo) + url := fmt.Sprintf("https://github.com/%s/%s/releases/latest", owner, repo) + httpCli := gh.client.Client() + req, err := gh.client.NewRequest("GET", url, nil) if err != nil { - return errors.Wrap(err, "failed to get latest tag") + return err + } + req.Header.Set("Accept", "application/json") + req = req.WithContext(ctx) + resp, err := httpCli.Do(req) + if err != nil { + return err + } + if resp.StatusCode == http.StatusOK { + var latestResp struct { + TagName string `json:"tag_name"` + } + err := json.NewDecoder(resp.Body).Decode(&latestResp) + if err != nil { + return err + } + tag = latestResp.TagName + } else { + rel, _, err := gh.client.Repositories.GetLatestRelease(ctx, owner, repo) + if err != nil { + return errors.Wrap(err, "failed to get latest tag") + } + tag = rel.GetTagName() } - tag = rel.GetTagName() + resp.Body.Close() } goarch := runtime.GOARCH From 57046600246a47495648cd12d14f436df6c0292d Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 2 Jan 2023 21:29:03 +0900 Subject: [PATCH 11/13] fix badge --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b26adb..3685cf1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ ghg ======= -[![Build Status](https://travis-ci.org/Songmu/ghg.png?branch=main)][travis] +[![Test Status](https://github.com/Songmu/ghg/workflows/test/badge.svg?branch=main)][actions] [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)][license] [![Coverage Status](https://codecov.io/gh/Songmu/ghg/branch/main/graph/badge.svg)][codecov] [![PkgGoDev](https://pkg.go.dev/badge/github.com/Songmu/ghg)][PkgGoDev] -[travis]: https://travis-ci.org/Songmu/ghg +[actions]: https://github.com/Songmu/ghg/actions?workflow=test [codecov]: https://codecov.io/gh/Songmu/ghg [license]: https://github.com/Songmu/ghg/blob/main/LICENSE [PkgGoDev]: https://pkg.go.dev/github.com/Songmu/ghg From bba7804c3ab1ec99fed6a11779512ae7bbe88c7f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 2 Jan 2023 12:29:27 +0000 Subject: [PATCH 12/13] [tagpr] prepare for the next release --- .github/release.yml | 4 ++++ .tagpr | 35 +++++++++++++++++++++++++++++++++++ version.go | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/release.yml create mode 100644 .tagpr diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..b0c5175 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,4 @@ +changelog: + exclude: + labels: + - tagpr diff --git a/.tagpr b/.tagpr new file mode 100644 index 0000000..f8909c7 --- /dev/null +++ b/.tagpr @@ -0,0 +1,35 @@ +# config file for the tagpr in git config format +# The tagpr generates the initial configuration, which you can rewrite to suit your environment. +# CONFIGURATIONS: +# tagpr.releaseBranch +# Generally, it is "main." It is the branch for releases. The tagpr tracks this branch, +# creates or updates a pull request as a release candidate, or tags when they are merged. +# +# tagpr.versionFile +# Versioning file containing the semantic version needed to be updated at release. +# It will be synchronized with the "git tag". +# Often this is a meta-information file such as gemspec, setup.cfg, package.json, etc. +# Sometimes the source code file, such as version.go or Bar.pm, is used. +# If you do not want to use versioning files but only git tags, specify the "-" string here. +# You can specify multiple version files by comma separated strings. +# +# tagpr.vPrefix +# Flag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true) +# This is only a tagging convention, not how it is described in the version file. +# +# tagpr.changelog (Optional) +# Flag whether or not changelog is added or changed during the release. +# +# tagpr.command (Optional) +# Command to change files just before release. +# +# tagpr.tmplate (Optional) +# Pull request template in go template format +# +# tagpr.release (Optional) +# GitHub Release creation behavior after tagging [true, draft, false] +# If this value is not set, the release is to be created. +[tagpr] + vPrefix = true + releaseBranch = main + versionFile = version.go diff --git a/version.go b/version.go index fccab59..ccfefce 100644 --- a/version.go +++ b/version.go @@ -1,5 +1,5 @@ package ghg -const version = "0.2.0" +const version = "0.3.0" var revision = "Devel" From 716713e825f47ffa1dcd4e4c5e2a272c5ee84785 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 2 Jan 2023 12:29:28 +0000 Subject: [PATCH 13/13] [tagpr] update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2028f2c..77373b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [v0.3.0](https://github.com/Songmu/ghg/compare/v0.2.0...v0.3.0) - 2023-01-02 +- update release related stuffs by @Songmu in https://github.com/Songmu/ghg/pull/18 +- update deps by @Songmu in https://github.com/Songmu/ghg/pull/20 +- use os.UserHomeDir instead of go-homedir by @Songmu in https://github.com/Songmu/ghg/pull/21 +- migrate to go-github from octokit by @Songmu in https://github.com/Songmu/ghg/pull/22 +- quess download url before requesting assets list by @Songmu in https://github.com/Songmu/ghg/pull/23 +- detect latest tag without using API by @Songmu in https://github.com/Songmu/ghg/pull/24 + ## [v0.2.0](https://github.com/Songmu/ghg/compare/v0.1.4...v0.2.0) (2019-01-29) * apply go modules and update mholt/archiver unarchive method [#17](https://github.com/Songmu/ghg/pull/17) ([zrma](https://github.com/zrma))