Skip to content

Commit

Permalink
ci: rework
Browse files Browse the repository at this point in the history
Signed-off-by: Unai Martinez-Corral <[email protected]>
  • Loading branch information
umarcor committed May 19, 2023
1 parent 8e245cc commit ff20af7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 30 deletions.
37 changes: 37 additions & 0 deletions ci/action.sh
Original file line number Diff line number Diff line change
@@ -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
34 changes: 4 additions & 30 deletions ci/action.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ff20af7

Please sign in to comment.