Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: rework #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions ci/action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

set -e

# 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