diff --git a/action.yml b/action.yml index d93255d..edcf615 100644 --- a/action.yml +++ b/action.yml @@ -24,4 +24,4 @@ runs: shell: bash run: | echo We are on "${{runner.os}}", requested "${{inputs.compiler}}" as CC - setup "${{ runner.os }}" "${{inputs.compiler}}" "${{inputs.ssl}}" + ${GITHUB_ACTION_PATH}/setup "${{ runner.os }}" "${{inputs.compiler}}" "${{inputs.ssl}}" diff --git a/setup b/setup index 82131e6..58d07ac 100755 --- a/setup +++ b/setup @@ -10,11 +10,10 @@ DISTRO=$(grep -E '^NAME=' /etc/os-release | # Installs a package using the native OS's package manager. install_pkg() { case $DISTRO in - "Ubuntu") - "Debian GNU/Linux" ) + "Ubuntu"|"Debian GNU/Linux") apt install -y $1 ;; - "Arch Linux" ) + "Arch Linux") pacman -Syu --noconfirm $1 ;; esac @@ -23,15 +22,14 @@ install_pkg() { install_compiler() { echo '::group::Setting up a compiler' case $DISTRO in - "Ubuntu" ) - "Debian GNU/Linux" ) + "Ubuntu"|"Debian GNU/Linux") install_pkg build-essential [ $COMPILER = 'clang' ] && install_pkg clang CC=gcc [ $COMPILER = 'clang' ] && CC=clang ;; - "Arch Linux" ) + "Arch Linux") install_pkg $COMPILER make CC=gcc [ $COMPILER = 'clang' ] && CC=clang @@ -41,13 +39,12 @@ install_compiler() { install_ssl() { echo '::group::Setting up SSL' case $DISTRO in - "Ubuntu" ) - "Debian GNU/Linux" ) + "Ubuntu"|"Debian GNU/Linux") # Doesn't seem like Debian got LibreSSL [ $SSL = 'libressl' ] && echo "::error ::LibreSSL is not on Debian" install_pkg openssl ;; - "Arch Linux" ) + "Arch Linux") install_pkg $SSL esac echo '::endgroup::'