added adopt-info to grab version from git tag

This commit is contained in:
Pietro Pasotti 2025-03-14 13:14:02 +01:00
parent 7852b8900b
commit a07dbe45cc
No known key found for this signature in database
GPG Key ID: 9BF96592261B41D2
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
name: grpcurl name: grpcurl
base: core24 base: core24
version: '0.1' # allow grpcurl part to call craftctl set-version
adopt-info: grpcurl
summary: grpcurl is a command-line tool that lets you interact with gRPC servers. summary: grpcurl is a command-line tool that lets you interact with gRPC servers.
description: | description: |
@ -23,6 +24,9 @@ parts:
source: https://github.com/fullstorydev/grpcurl source: https://github.com/fullstorydev/grpcurl
source-type: git source-type: git
override-build: | override-build: |
tag="$(git describe --tags --abbrev=0)"
craftctl set version="$tag"
go build -o $CRAFT_PART_INSTALL/grpcurl ./cmd/grpcurl/grpcurl.go go build -o $CRAFT_PART_INSTALL/grpcurl ./cmd/grpcurl/grpcurl.go
# adjust the permissions # adjust the permissions