requires:
- name: "toolchain-go"
  category: "development"
  version: ">=0"
prelude:
- mkdir go/src/github.com/${GITHUB_ORG}/ -p
- cd go/src/github.com/${GITHUB_ORG}/ && git clone https://github.com/${GITHUB_ORG}/{{ .Values.name }}.git
env:
- GOPATH=/luetbuild/go/
- GITHUB_ORG={{ ( index .Values.labels "github.owner" ) }}
- CGO_ENABLED=0
steps:
- |
  PACKAGE_VERSION=${PACKAGE_VERSION%\-*} && \
  cd go/src/github.com/${GITHUB_ORG}/{{ .Values.name }}/  && git checkout v"${PACKAGE_VERSION}" -b build && go build -ldflags="-w -s -X github.com/mudler/edgevpn/internal.Version=v$PACKAGE_VERSION" && mv {{.Values.name}} /usr/bin/
- chmod +x /usr/bin/{{.Values.name}}
includes:
- /usr/bin/{{.Values.name}}
