Skip to content

Commit

Permalink
Download/uncompress ninja binary directly from its repository
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Apr 26, 2024
1 parent 3e85fb0 commit 6e30a59
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
8 changes: 3 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ runs:
using: "composite"
steps:
- name: Install on Mac/Linux/Windows
run: |
pip3 install wheel setuptools
pip3 install ninja --upgrade
run: install-ninja.sh
shell: bash
- name: Fix path on Linux
- name: Fix path
run: |
echo "/home/runner/.local/bin" >> $GITHUB_PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash
- name: Fill in output variable
id: output_version
Expand Down
5 changes: 5 additions & 0 deletions checksums.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
daa94231f55bf32a46b1b45e3a0dc767f73483a681d3277923833df9ac4f12532d67e9aca2f45768f31c8b3b8e63149d69867cb0a0e6c48683f197bf2634d681 ninja-linux-aarch64.zip
a6d4c8410cc7cd0eced47518b8deca90af9e6f9b1e9fba992bcc5bc92645d07e20bd005a59c90c4c24cded68a4f2178f3a2043707e578e326881ffdaae073f2f ninja-linux.zip
cb271573df79c36a61bf6f63ff7aca7e2e7e3764c1ef0ce8e6f4667dae54326f905061cf56f19aea37625c94eeb96abc8f643b14d0e65da70e2e6cf9d127a52a ninja-win.zip
23726030fa0ffd05afef6cf75042ad7518fb954af058f85a8a3fdab4e8d157ef42347b6232d20c1a609e91d9c38ebfd2f1cdc751ca6eb1f87e333cc6971455a5 ninja-mac.zip
35b9228d91c133eabf8318b0842d6621be7b11ffaa46bfc3cf0cfe9aa5858c2db7b5dc7c475444f0da8cd07b35304e0c61f53cf264f258a6902c74b26438c248 ninja-winarm64.zip
34 changes: 34 additions & 0 deletions install-ninja.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /usr/bin/bash

echo "RUNNER_OS=$RUNNER_OS"
echo "RUNNER_ARCH=$RUNNER_ARCH"
wget=wget
if [ "$RUNNER_OS" == "Windows" ]; then
if [ "$RUNNER_ARCH" == "ARM64" ]; then
filename=ninja-winarm64.zip
else
filename=ninja-win.zip
fi
wget=C:/msys64/usr/bin/wget.exe
elif [ "$RUNNER_OS" == "macOS" ]; then
filename=ninja-mac.zip
elif [ "$RUNNER_OS" == "Linux" ]; then
if [ "$RUNNER_ARCH" == "ARM64" ]; then
filename=ninja-linux-aarch64.zip
else
filename=ninja-linux.zip
fi
else
echo "$RUNNER_OS not supported"
exit 1
fi
if ! $wget "https://github.com/ninja-build/ninja/releases/download/v1.12.0/$filename" ; then
echo "Couldn't download $filename file"
exit 2
fi
if ! sha512sum --ignore-missing --check checksums.txt ; then
echo "Invalid SHA512 checksum"
exit 3
fi
mkdir -p "$HOME/.local/bin"
unzip -d "$HOME/.local/bin" "$filename"

0 comments on commit 6e30a59

Please sign in to comment.