Skip to content

Commit 9e412d1

Browse files
committed
insert the commit SHA in Windows binary releases
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
1 parent a92641b commit 9e412d1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: .github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ jobs:
6767
- name: Package and release FStar
6868
shell: C:\cygwin64\bin\bash.exe --login '{0}'
6969
run: |
70-
CI_THREADS=24 $GITHUB_WORKSPACE/.scripts/release.sh && echo "There is a CR at the end of this line"
70+
FSTAR_COMMIT=$GITHUB_SHA CI_THREADS=24 $GITHUB_WORKSPACE/.scripts/release.sh && echo "There is a CR at the end of this line"
7171
env:
7272
GH_TOKEN: ${{ secrets.DZOMO_GITHUB_TOKEN }}

Diff for: ocaml/fstar-lib/make_fstar_version.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ else
1414
fi
1515
COMPILER="OCaml $(ocamlc -version)"
1616
# If a system does not have git, or we are not in a git repo, fallback with "unset"
17-
COMMIT=$(git describe --match="" --always --abbrev=40 --dirty 2>/dev/null || echo unset)
17+
if [[ -z "$FSTAR_COMMIT" ]] ; then
18+
FSTAR_COMMIT=$(git describe --match="" --always --abbrev=40 --dirty 2>/dev/null || echo unset)
19+
fi
1820
COMMITDATE=$(git log --pretty=format:%ci -n 1 2>/dev/null || echo unset)
1921

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

0 commit comments

Comments
 (0)