From 153f132b2e86d9d348a8d21e9986ca255630f910 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Sun, 27 Dec 2020 11:50:18 +0100 Subject: [PATCH] update ci --- .builds/scripts/notify-gitter | 9 +++-- .github/notify-gitter.sh | 4 +-- .github/workflows/cmake-build-ci.gen | 14 ++++---- .github/workflows/cmake-build-ci.yml | 54 +++++++++++++++++----------- 4 files changed, 49 insertions(+), 32 deletions(-) diff --git a/.builds/scripts/notify-gitter b/.builds/scripts/notify-gitter index 7be63d08..cac46b75 100755 --- a/.builds/scripts/notify-gitter +++ b/.builds/scripts/notify-gitter @@ -10,12 +10,17 @@ REF_URL=https://github.com/${REPO}/commits/${REF} BUILD_URL=${JOB_URL} BUILD_TAG=$(uname -o 2>/dev/null || uname -s) -if test "$BUILD_TAG" = "GNU/Linux" +if expr match "$BUILD_TAG" ".*Linux" >/dev/null then BUILD_TAG=$(lsb_release -irs) fi BUILD_CXX=$(c++ --version | head -1) -BUILD_ENV=${BUILD_TAG}/${BUILD_CXX} +if expr match "${BUILD_CXX}" "${BUILD_TAG}" >/dev/null +then + BUILD_ENV="${BUILD_CXX}" +else + BUILD_ENV="${BUILD_TAG}/${BUILD_CXX}" +fi case "$STATUS" in success) diff --git a/.github/notify-gitter.sh b/.github/notify-gitter.sh index edfe9995..036e932c 100755 --- a/.github/notify-gitter.sh +++ b/.github/notify-gitter.sh @@ -1,6 +1,4 @@ #!/usr/bin/env bash -GITTER=$1 - REPO=${GITHUB_REPOSITORY} REF=$(basename ${GITHUB_REF}) @@ -9,7 +7,7 @@ REF_URL=https://github.com/${REPO}/commits/${REF} BUILD_URL=https://github.com/${REPO}/actions/runs/${GITHUB_RUN_ID} BUILD_ENV=${ImageOS}/${CC:-${CC_VND}-${CC_VER}} -case "$2" in +case "$1" in 1|true|success) level=info status=success diff --git a/.github/workflows/cmake-build-ci.gen b/.github/workflows/cmake-build-ci.gen index 5cdc10c8..cf187136 100755 --- a/.github/workflows/cmake-build-ci.gen +++ b/.github/workflows/cmake-build-ci.gen @@ -250,7 +250,7 @@ function steps_package() { - name: Package env: PUSH_ARTIFACTS_ID: ${{ secrets.PUSH_ARTIFACTS_ID }} - if: env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') + if: env.PUSH_ARTIFACTS_ID != '' && env.CMAKE_BUILD_TYPE == 'Release' && !(env.OS_VER == 'ubuntu-18.04' && env.CC_VND == 'gnu' && env.CC_VER == 'new ') run: | cmake --config ${{ env.CMAKE_BUILD_TYPE }} -S . -B build cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} -j2 --target package @@ -263,8 +263,10 @@ function steps_package() { function steps_notify($os_vnd) { ?> - name: Notify Gitter - if: success() || failure() - run: bash .github/notify-gitter.sh ${{ secrets.GITTER }} ${{ job.status }} + env: + GITTER: ${{ secrets.GITTER }} + if: (success() || failure()) && env.GITTER != '' + run: bash .github/notify-gitter.sh ${{ job.status }}