* +glab

* typo

* builds and tests working

* all tests pass except for version test

* oops fix test

* `var version` rather than `var Version`

---------

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
David Dobrinskiy 2023-04-05 04:13:45 +05:00 committed by GitHub
parent 46322bf8b5
commit 235fa66483
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,41 @@
distributable:
url: https://gitlab.com/gitlab-org/cli/-/archive/v{{version}}/cli-v{{version}}.tar.gz
strip-components: 1
versions:
- 1.26.0
provides:
- bin/glab
build:
script: |
go mod download
mkdir -p "{{ prefix }}"/bin
go build -v -trimpath -ldflags="$LDFLAGS" -o $BUILDLOC ./cmd/glab
dependencies:
go.dev: ^1.18
env:
GO111MODULE: 'on'
BUILDLOC: '{{prefix}}/bin/glab'
LDFLAGS:
- -s
- -w
- -X main.version={{version}}
- -X main.debugMode=false
linux:
# or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
LDFLAGS:
- -buildmode=pie
test:
dependencies:
git-scm.org: '*'
script: |
git clone https://gitlab.com/cli-automated-testing/homebrew-testing.git
cd homebrew-testing
glab repo contributors | grep "Matt Nohr"
glab issue list --all | grep "This is a test issue"
glab --version | grep "glab version {{version}}"