Skip to content

Commit

Permalink
Add version info
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg1969 committed Apr 14, 2024
1 parent 412982a commit 19a24a3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version info
run: |
/bin/echo -n Extracting and updating version information...
DESCR=$(git describe --long)
VERSION=$(echo "$DESCR" | cut -d '-' -f 1)
BUILD=$(echo "$DESCR" | cut -d '-' -f 2)
BCOMMIT=$(echo "$DESCR" | cut -d '-' -f 3 | sed 's@^g@@')
BDATE=$(git log -n1 --pretty=%ad --date=local)
MONTH=`date +%B`
MONBIB=`date +%b | tr [:upper:] [:lower:]`
YEAR=`date +%Y`
echo done.
echo "Version $DESCR, $MONTH $YEAR"
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
mv -f cvx_version.new cvx_version.m
- name: Retrieve artifacts
uses: actions/download-artifact@v4
- name: Move artifacts into place
Expand Down
2 changes: 1 addition & 1 deletion cvx_version.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
line = '---------------------------------------------------------------------------';
fprintf( '\n%s\n', line );
fprintf( 'CVX: Software for Disciplined Convex Programming (c)2014 CVX Research\n' );
fprintf( 'Version %3s, Build %4s (%7s)%42s\n', cvx_ver, cvx_bld, cvx_bcomm, cvx_bdate );
fprintf( 'Version %3s, Build %3s (%7s)%42s\n', cvx_ver, cvx_bld, cvx_bcomm, cvx_bdate );
fprintf( '%s\n', line );
fprintf( 'Installation info:\n Path: %s\n', cvx___.where );
if isoctave,
Expand Down

0 comments on commit 19a24a3

Please sign in to comment.