diff --git a/.ci/ci_build.sh b/.ci/ci_build.sh index e2344f5b..45fd8ead 100755 --- a/.ci/ci_build.sh +++ b/.ci/ci_build.sh @@ -9,6 +9,10 @@ elif [ "$SYSTEM_COLLECTIONID" != "" ]; then # Azure Pipelines CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')" CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY" +elif [ "$HOME" != "" ]; then + # GitHub Actions + CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')" + CI_BUILD_DIR="$GITHUB_WORKSPACE" else # for executing in non ci environment CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')" @@ -18,7 +22,7 @@ fi [ -z "${BUILD_TYPE}" ] && BUILD_TYPE="Debug" # Determine cmake build type; tag builds are Release, else Debug (-dev appends to platform) -if [[ $BUILD_SOURCEBRANCH == *"refs/tags"* ]]; then +if [[ $BUILD_SOURCEBRANCH == *"refs/tags"* || $GITHUB_REF == *"refs/tags"* ]]; then BUILD_TYPE=Release else PLATFORM=${PLATFORM}-dev diff --git a/.ci/ci_install.sh b/.ci/ci_install.sh index 7efa31d4..46d61738 100755 --- a/.ci/ci_install.sh +++ b/.ci/ci_install.sh @@ -4,9 +4,15 @@ if [ -n "${TRAVIS-}" ]; then # Travis-CI CI_NAME="$(echo "$TRAVIS_OS_NAME" | tr '[:upper:]' '[:lower:]')" + CI_BUILD_DIR="$TRAVIS_BUILD_DIR" elif [ "$SYSTEM_COLLECTIONID" != "" ]; then # Azure Pipelines CI_NAME="$(echo "$AGENT_OS" | tr '[:upper:]' '[:lower:]')" + CI_BUILD_DIR="$BUILD_SOURCESDIRECTORY" +elif [ "$HOME" != "" ]; then + # GitHub Actions + CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')" + CI_BUILD_DIR="$GITHUB_WORKSPACE" else # for executing in non ci environment CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..6116a8e2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: GitHub Actions +on: [push, pull_request] + +jobs: + Linux: + name: ${{ matrix.dockerName }} + runs-on: ubuntu-latest + strategy: + matrix: + dockerTag: [ amd64, i386, armv6hf, armv7hf, aarch64 ] + include: + - dockerTag: amd64 + dockerName: Debian Stretch (AMD64) + platform: x11 + - dockerTag: i386 + dockerName: Debian Stretch (i386) + platform: x11 + - dockerTag: armv6hf + dockerName: Debian Stretch (Raspberry Pi v1 & ZERO) + platform: rpi + - dockerTag: armv7hf + dockerName: Debian Stretch (Raspberry Pi 2 & 3) + platform: rpi + - dockerTag: aarch64 + dockerName: Debian Stretch (Generic AARCH64) + platform: amlogic + + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + # build process + - name: Build packages + env: + DOCKER_TAG: ${{ matrix.dockerTag }} + DOCKER_NAME: ${{ matrix.dockerName }} + PLATFORM: ${{ matrix.platform }} + shell: bash + run: ./.ci/ci_build.sh + + # create/update github release (replacement for Microsoft Azure after the beta phase) + +# - name: Create/Update GitHub release +# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() +# uses: docker://softprops/action-gh-release +# with: +# files: deploy/Hyperion.NG-* +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + macOS: + name: macOS + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + with: + submodules: true + + # install dependencies + - name: Install dependencies + shell: bash + run: ./.ci/ci_install.sh + + # build process + - name: Build packages + env: + PLATFORM: osx + shell: bash + run: ./.ci/ci_build.sh + + # create/update github release (replacement for Microsoft Azure after the beta phase) + +# - name: Create/Update GitHub release +# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() +# uses: docker://softprops/action-gh-release +# with: +# files: deploy/Hyperion.NG-* +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index e639811a..b0893365 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Dependencies](https://img.shields.io/librariesio/github/hyperion-project/hyperion.ng.svg)](https://github.com/hyperion-project/hyperion.ng/tree/master/dependencies/external) [![Azure-Pipeline](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_apis/build/status/Hyperion.NG?branchName=master)](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_build/latest?definitionId=7&branchName=master) [![Travis-CI](https://travis-ci.org/hyperion-project/hyperion.ng.svg?branch=master)](https://travis-ci.org/hyperion-project/hyperion.ng) +[![GitHub Actions](https://github.com/hyperion-project/hyperion.ng/workflows/GitHub%20Actions/badge.svg)](https://github.com/hyperion-project/hyperion.ng/actions) [![LGTM](https://img.shields.io/lgtm/alerts/g/hyperion-project/hyperion.ng.svg)](https://lgtm.com/projects/g/hyperion-project/hyperion.ng/alerts/) [![Documentation](https://codedocs.xyz/hyperion-project/hyperion.ng.svg)](https://codedocs.xyz/hyperion-project/hyperion.ng/)