From 86627cc70fb3e9fe3b9fe8c33df0cc840e1ed8e2 Mon Sep 17 00:00:00 2001 From: maximebuyse <45398004+maximebuyse@users.noreply.github.com> Date: Tue, 20 Jan 2026 17:03:47 +0100 Subject: [PATCH 1/4] Update action.yml --- action.yml | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b1ff22f..d95ff10 100644 --- a/action.yml +++ b/action.yml @@ -21,8 +21,45 @@ runs: with: use-flakehub: false - - name: Install F* + - name: Try to install prebuilt F* binary if: inputs.fstar != '' + id: binary-install + shell: bash + run: | + VERSION="${{ inputs.version }}" + OS_NAME=$(uname -s) + ARCH=$(uname -m) + + # Map OS and Architecture to the URL format + if [ "$OS_NAME" = "Darwin" ]; then + PLATFORM="Darwin-arm64" + elif [ "$OS_NAME" = "Linux" ] && [ "$ARCH" = "x86_64" ]; then + PLATFORM="Linux-x86_64" + else + echo "Unsupported platform for binary; falling back to Nix." + echo "installed=false" >> $GITHUB_OUTPUT + exit 0 + fi + + URL="https://github.com/FStarLang/FStar/releases/download/$VERSION/fstar-$VERSION-$PLATFORM.tar.gz" + + # Check if the URL exists using a HEAD request + if curl --output /dev/null --silent --head --fail "$URL"; then + echo "Downloading $URL..." + curl -L "$URL" -o fstar.tar.gz + mkdir -p $HOME/.fstar + tar -xzf fstar.tar.gz -C $HOME/.fstar --strip-components=1 + + # Add the bin directory to the GitHub PATH + echo "$HOME/.fstar/bin" >> $GITHUB_PATH + echo "installed=true" >> $GITHUB_OUTPUT + else + echo "Prebuilt binary not found at $URL; falling back to Nix." + echo "installed=false" >> $GITHUB_OUTPUT + fi + + - name: Install F* + if: inputs.fstar != '' && steps.binary-install.outputs.installed == 'false' shell: bash run: nix profile install "$FLAKE" env: From a1a81507da283a056c253c0e471997526732fbf0 Mon Sep 17 00:00:00 2001 From: maximebuyse <45398004+maximebuyse@users.noreply.github.com> Date: Tue, 20 Jan 2026 17:16:08 +0100 Subject: [PATCH 2/4] Inject F* version as env var --- action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index d95ff10..b626091 100644 --- a/action.yml +++ b/action.yml @@ -25,8 +25,9 @@ runs: if: inputs.fstar != '' id: binary-install shell: bash + env: + VERSION: "${{ inputs.version }}" run: | - VERSION="${{ inputs.version }}" OS_NAME=$(uname -s) ARCH=$(uname -m) From 06013d8a60610fcc3fb453065191387b890b142c Mon Sep 17 00:00:00 2001 From: maximebuyse <45398004+maximebuyse@users.noreply.github.com> Date: Tue, 20 Jan 2026 17:18:05 +0100 Subject: [PATCH 3/4] Correct input for F* version. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b626091..6941a42 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ runs: id: binary-install shell: bash env: - VERSION: "${{ inputs.version }}" + VERSION: "${{ inputs.fstar }}" run: | OS_NAME=$(uname -s) ARCH=$(uname -m) From 6c734302f9a0434cf590e0ba18c9dd9b28fc6659 Mon Sep 17 00:00:00 2001 From: Maxime Buyse Date: Wed, 21 Jan 2026 10:02:07 +0100 Subject: [PATCH 4/4] Fix number of directories to strip. --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 6941a42..5743d94 100644 --- a/action.yml +++ b/action.yml @@ -49,7 +49,7 @@ runs: echo "Downloading $URL..." curl -L "$URL" -o fstar.tar.gz mkdir -p $HOME/.fstar - tar -xzf fstar.tar.gz -C $HOME/.fstar --strip-components=1 + tar -xzf fstar.tar.gz -C $HOME/.fstar --strip-components=2 # Add the bin directory to the GitHub PATH echo "$HOME/.fstar/bin" >> $GITHUB_PATH