pantry/projects/gitlab.com/gitlab-org/cli/package.yml
David Dobrinskiy 235fa66483
+glab (#871)
* +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>
2023-04-04 19:13:45 -04:00

41 lines
1,004 B
YAML

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}}"