Skip to content

Commit

Permalink
insert the commit SHA in Windows binary releases
Browse files Browse the repository at this point in the history
the Windows release task does not checkout the
F* repository with the git command, but rather
with the GitHub REST API, so we need to get
the commit hash from outside
  • Loading branch information
tahina-pro committed Apr 10, 2023
1 parent a92641b commit 9e412d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:
- name: Package and release FStar
shell: C:\cygwin64\bin\bash.exe --login '{0}'
run: |
CI_THREADS=24 $GITHUB_WORKSPACE/.scripts/release.sh && echo "There is a CR at the end of this line"
FSTAR_COMMIT=$GITHUB_SHA CI_THREADS=24 $GITHUB_WORKSPACE/.scripts/release.sh && echo "There is a CR at the end of this line"
env:
GH_TOKEN: ${{ secrets.DZOMO_GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions ocaml/fstar-lib/make_fstar_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ else
fi
COMPILER="OCaml $(ocamlc -version)"
# If a system does not have git, or we are not in a git repo, fallback with "unset"
COMMIT=$(git describe --match="" --always --abbrev=40 --dirty 2>/dev/null || echo unset)
if [[ -z "$FSTAR_COMMIT" ]] ; then
FSTAR_COMMIT=$(git describe --match="" --always --abbrev=40 --dirty 2>/dev/null || echo unset)
fi
COMMITDATE=$(git log --pretty=format:%ci -n 1 2>/dev/null || echo unset)

echo "let dummy () = ();;"
Expand All @@ -23,4 +25,4 @@ echo "FStar_Options._platform := \"$PLATFORM\";;"
echo "FStar_Options._compiler := \"$COMPILER\";;"
# We deliberately use commitdate instead of date, so that rebuilds are no-ops
echo "FStar_Options._date := \"$COMMITDATE\";;"
echo "FStar_Options._commit:= \"$COMMIT\";;"
echo "FStar_Options._commit:= \"$FSTAR_COMMIT\";;"

0 comments on commit 9e412d1

Please sign in to comment.