From 0c4f5b3ad927a05787f82f71782f8182ad6ec9f8 Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Tue, 1 Jun 2021 10:13:28 -0700 Subject: [PATCH] Remove sudo from apt-get echo to stderr --- .github/workflows/crystal.yml | 12 ++++++++++-- build/env.sh | 6 +++--- build/libsodium_install.sh | 10 +++++----- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/crystal.yml b/.github/workflows/crystal.yml index 502a91c..fcd4e10 100644 --- a/.github/workflows/crystal.yml +++ b/.github/workflows/crystal.yml @@ -8,7 +8,6 @@ on: jobs: build: - runs-on: ubuntu-latest container: @@ -16,8 +15,14 @@ jobs: steps: - uses: actions/checkout@v2 + - name: apt update + run: apt update + - name: Install lsb_release + run: apt-get install -y lsb-release + - name: lsb_release + run: lsb_release -a - name: Install wget - run: sudo apt-get install wget + run: apt-get install -y wget - name: setenv DEBUG run: echo "SODIUM_BUILD_DEBUG=1" >> $GITHUB_ENV - name: setenv BUILD_DIR @@ -30,4 +35,7 @@ jobs: run: shards build -Dpreview_mt - name: Run format run: crystal tool format --check + - name: Failed + if: ${{ failure() }} + run: "[ -f libsodium_install.out ] && cat libsodium_install.out" diff --git a/build/env.sh b/build/env.sh index 0f62155..4bc275a 100644 --- a/build/env.sh +++ b/build/env.sh @@ -17,13 +17,13 @@ if `pkg-config libsodium --exists`; then PKG_VER=`pkg-config libsodium --modversion` if [ $(version "$PKG_VER") -ge $(version "$MIN_LIBSODIUM_VERSION") ]; then - [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using packaged libsodium." + [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using packaged libsodium." 1>&2 else - [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "System packaged libsodium is too old." + [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "System packaged libsodium is too old." 1>&2 export LIBSODIUM_INSTALL=1 fi else - [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Missing libsodium system package." + [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Missing libsodium system package." 1>&2 export LIBSODIUM_INSTALL=1 fi diff --git a/build/libsodium_install.sh b/build/libsodium_install.sh index cb5573d..093cab2 100755 --- a/build/libsodium_install.sh +++ b/build/libsodium_install.sh @@ -12,7 +12,7 @@ set -e #export LIBSODIUM_INSTALL="1" if [ "$LIBSODIUM_INSTALL" != "1" ]; then - [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Skipping libsodium build." + [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Skipping libsodium build." 1>&2 exit 0 fi @@ -40,8 +40,8 @@ if [ ! -f "$LIBSODIUM_INSTALL_PATH/include/sodium.h" ]; then SHA=`openssl sha256 -hex < "$TGZ_FILENAME" | sed 's/^.* //'` if [ "$SHA" != "$LIBSODIUM_SHA256" ]; then - echo "SHA256 sum doesn't match." - echo "$SHA" != "$LIBSODIUM_SHA256" + echo "SHA256 sum doesn't match." 1>&2 + echo "$SHA" != "$LIBSODIUM_SHA256" 1>&2 exit 1 fi @@ -64,11 +64,11 @@ if [ ! -f "$LIBSODIUM_INSTALL_PATH/include/sodium.h" ]; then touch .make.install.done fi - [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Finished building libsodium." + [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Finished building libsodium." 1>&2 else # find "$LIBSODIUM_INSTALL_PATH" - [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using already built libsodium." + [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using already built libsodium." 1>&2 fi exit 0