Skip to content

Commit 82f8d7b

Browse files
committed
ci: rework
Signed-off-by: Unai Martinez-Corral <[email protected]>
1 parent 2ab2470 commit 82f8d7b

File tree

2 files changed

+43
-30
lines changed

2 files changed

+43
-30
lines changed

ci/action.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# Build
6+
if [ $SKIP ]; then
7+
exit 0;
8+
fi
9+
10+
if [ $OS_NAME = "windows" ]; then
11+
export PATH="$PATH:/c/ProgramData/Chocolatey/bin/:/c/Program Files/Git/usr/bin/"
12+
fi
13+
14+
export CI_SCRIPTS_PATH=${CI_SCRIPTS_PATH:-$(dirname "$0")}
15+
16+
source $CI_SCRIPTS_PATH/common.sh
17+
18+
# Download SDK
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+
25+
bash $CI_SCRIPTS_PATH/install.sh
26+
27+
set -x
28+
29+
if [ $SCRIPT ]; then
30+
bash $SCRIPT
31+
else
32+
bash $CI_SCRIPTS_PATH/script.sh
33+
fi
34+
35+
if [ $? -eq 0 ]; then
36+
source $CI_SCRIPTS_PATH/after_success.sh
37+
else
38+
source $CI_SCRIPTS_PATH/after_failure.sh
39+
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)