File: ci-set-ldflags.sh

package info (click to toggle)
relic 7.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,108 kB
  • sloc: sh: 230; makefile: 10
file content (8 lines) | stat: -rw-r--r-- 356 bytes parent folder | download
1
2
3
4
5
6
7
8
# If this is a release build, set version to the tag. Otherwise set it to the commit hash.
version="${GITHUB_REF#refs/tags/v*}"
[ "$version" == "$GITHUB_REF" ] && version=$GITHUB_SHA

ldflags="-s -w -X main.version=$version -X main.commit=$GITHUB_SHA"

# Propagate these flags to all further steps in the current job
echo "ldflags=$ldflags" >> $GITHUB_ENV