Skip to content

Commit fa87dee

Browse files
committed
ci: rework
Signed-off-by: Unai Martinez-Corral <[email protected]>
1 parent 06db64e commit fa87dee

File tree

2 files changed

+41
-30
lines changed

2 files changed

+41
-30
lines changed

ci/action.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
# Build
4+
if [ $SKIP ]; then
5+
exit 0;
6+
fi
7+
8+
if [ $OS_NAME = "windows" ]; then
9+
export PATH="$PATH:/c/ProgramData/Chocolatey/bin/:/c/Program Files/Git/usr/bin/"
10+
fi
11+
12+
export CI_SCRIPTS_PATH=${CI_SCRIPTS_PATH:-$(dirname "$0")}
13+
14+
source $CI_SCRIPTS_PATH/common.sh
15+
16+
# Download SDK
17+
if [ $OS_NAME = 'osx' ]; then
18+
if [[ ! -d $HOME/sdk/MacOSX10.9.sdk ]]; then
19+
git clone https://github.com/phracker/MacOSX-SDKs $HOME/sdk
20+
fi
21+
fi
22+
23+
bash $CI_SCRIPTS_PATH/install.sh
24+
25+
set -x
26+
27+
if [ $SCRIPT ]; then
28+
bash $SCRIPT
29+
else
30+
bash $CI_SCRIPTS_PATH/script.sh
31+
fi
32+
33+
if [ $? -eq 0 ]; then
34+
source $CI_SCRIPTS_PATH/after_success.sh
35+
else
36+
source $CI_SCRIPTS_PATH/after_failure.sh
37+
fi

ci/action.yml

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
11
name: 'Package build'
2+
23
description: 'Build a package'
4+
35
runs:
46
using: "composite"
57
steps:
6-
- name: build
7-
run: |
8-
if [ $SKIP ]; then
9-
exit 0;
10-
fi
11-
if [ $OS_NAME = "windows" ]; then
12-
export PATH="$PATH:/c/ProgramData/Chocolatey/bin/"
13-
export PATH="$PATH:/c/Program Files/Git/usr/bin/"
14-
fi
15-
# Used in the scripts to locate other scripts.
16-
export CI_SCRIPTS_PATH="$GITHUB_ACTION_PATH"
178

18-
source $GITHUB_ACTION_PATH/common.sh
19-
if [ $OS_NAME = 'osx' ]; then
20-
if [[ ! -d $HOME/sdk/MacOSX10.9.sdk ]]; then
21-
git clone https://github.com/phracker/MacOSX-SDKs $HOME/sdk
22-
fi
23-
fi
24-
bash $GITHUB_ACTION_PATH/install.sh
25-
set -x
26-
if [ $SCRIPT ]; then
27-
bash $SCRIPT
28-
else
29-
bash $GITHUB_ACTION_PATH/script.sh
30-
fi
31-
if [ $? -eq 0 ]; then
32-
source $GITHUB_ACTION_PATH/after_success.sh
33-
else
34-
source $GITHUB_ACTION_PATH/after_failure.sh
35-
fi
36-
shell: bash
9+
- shell: bash
10+
run: $GITHUB_ACTION_PATH/action.sh

0 commit comments

Comments
 (0)