diff --git a/ci/action.sh b/ci/action.sh new file mode 100755 index 00000000..30bea998 --- /dev/null +++ b/ci/action.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Build +if [ $SKIP ]; then + exit 0; +fi + +if [ $OS_NAME = "windows" ]; then + export PATH="$PATH:/c/ProgramData/Chocolatey/bin/:/c/Program Files/Git/usr/bin/" +fi + +export CI_SCRIPTS_PATH=${CI_SCRIPTS_PATH:-$(dirname "$0")} + +source $CI_SCRIPTS_PATH/common.sh + +# Download SDK +if [ $OS_NAME = 'osx' ]; then + if [[ ! -d $HOME/sdk/MacOSX10.9.sdk ]]; then + git clone https://github.com/phracker/MacOSX-SDKs $HOME/sdk + fi +fi + +bash $CI_SCRIPTS_PATH/install.sh + +set -x + +if [ $SCRIPT ]; then + bash $SCRIPT +else + bash $CI_SCRIPTS_PATH/script.sh +fi + +if [ $? -eq 0 ]; then + source $CI_SCRIPTS_PATH/after_success.sh +else + source $CI_SCRIPTS_PATH/after_failure.sh +fi diff --git a/ci/action.yml b/ci/action.yml index dad36aed..38f44203 100644 --- a/ci/action.yml +++ b/ci/action.yml @@ -1,36 +1,10 @@ name: 'Package build' + description: 'Build a package' + runs: using: "composite" steps: - - name: build - run: | - if [ $SKIP ]; then - exit 0; - fi - if [ $OS_NAME = "windows" ]; then - export PATH="$PATH:/c/ProgramData/Chocolatey/bin/" - export PATH="$PATH:/c/Program Files/Git/usr/bin/" - fi - # Used in the scripts to locate other scripts. - export CI_SCRIPTS_PATH="$GITHUB_ACTION_PATH" - source $GITHUB_ACTION_PATH/common.sh - if [ $OS_NAME = 'osx' ]; then - if [[ ! -d $HOME/sdk/MacOSX10.9.sdk ]]; then - git clone https://github.com/phracker/MacOSX-SDKs $HOME/sdk - fi - fi - bash $GITHUB_ACTION_PATH/install.sh - set -x - if [ $SCRIPT ]; then - bash $SCRIPT - else - bash $GITHUB_ACTION_PATH/script.sh - fi - if [ $? -eq 0 ]; then - source $GITHUB_ACTION_PATH/after_success.sh - else - source $GITHUB_ACTION_PATH/after_failure.sh - fi - shell: bash + - shell: bash + run: $GITHUB_ACTION_PATH/action.sh