Skip to content

Commit 54691ae

Browse files
committed
Add version info
1 parent 412982a commit 54691ae

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ jobs:
8080
uses: actions/checkout@v4
8181
with:
8282
fetch-depth: 0
83+
- name: Extract version info
84+
run: |
85+
/bin/echo -n Extracting and updating version information...
86+
BUILD=`git log --pretty=format: | wc -l | sed s/^/$OFFSET+/ | bc`
87+
BDATE=`git log -n1 --pretty=%ad --date=local`
88+
BCOMMIT=`git log -n1 --pretty=%h`
89+
VERSION=`grep "^\s*cvx_ver" cvx_version.m | sed "s@^.*'\(.*\)'.\\$@\1@"`
90+
MONTH=`date +%B`
91+
MONBIB=`date +%b | tr [:upper:] [:lower:]`
92+
YEAR=`date +%Y`
93+
echo done.
94+
echo "Version $VERSION, $MONTH $YEAR, Build $BUILD ($BCOMMIT)"
95+
sed "s@cvx_bld *= *'[^']*'@cvx_bld = '$BUILD'@;s@cvx_bdate *= *'[^']*'@cvx_bdate = '$BDATE'@;s@cvx_bcomm *= *'[^']*'@cvx_bcomm = '$BCOMMIT'@" cvx_version.m > cvx_version.new
96+
mv -f cvx_version.new cvx_version.m
8397
- name: Retrieve artifacts
8498
uses: actions/download-artifact@v4
8599
- name: Move artifacts into place

0 commit comments

Comments
 (0)