-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Packaging: New version string on the form: '7.1.0-1+11+g2b25294`
Deb packages as artifacts in github actions
- Loading branch information
1 parent
1270bfe
commit 3b5b1b4
Showing
5 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
# Version script | ||
# Usage: | ||
# ./version.sh | ||
# with optional fields: | ||
# PREFIX= INDEX=1 ARCH= SUFFIX= | ||
# Example: | ||
# PREFIX=cligen INDEX=1 ARCH=amd64 SUFFIX=deb ./version.sh | ||
set -eu | ||
: ${PREFIX:=} | ||
: ${INDEX=1} | ||
: ${ARCH=} | ||
: ${SUFFIX=} | ||
# Get version string from default git describe: <tag>-<nr>-g<hash> | ||
if [ -f .version ]; then | ||
v1=$(cat .version) | ||
else | ||
v1=$(git describe) | ||
fi | ||
if [ -z $v1 ]; then | ||
echo "No base version" | ||
exit 1 | ||
fi | ||
TAG=$(echo $v1 | awk -F- '{print $1}') | ||
NR=$(echo $v1 | awk -F- '{print $2}') | ||
HASH=$(echo $v1 | awk -F- '{print $3}') | ||
V="" | ||
if [ -n "$PREFIX" ]; then | ||
V="${V}${PREFIX}_" | ||
fi | ||
V="${V}${TAG}" | ||
V="${V}-${INDEX}" | ||
V="${V}+${NR}" | ||
V="${V}+${HASH}" | ||
if [ -n "$ARCH" ]; then | ||
V="${V}_${ARCH}" | ||
fi | ||
if [ -n "$SUFFIX" ]; then | ||
V="${V}.${SUFFIX}" | ||
fi | ||
echo "${V}" |