Skip to content

Commit 0c77fb5

Browse files
committed
ci: rework
Signed-off-by: Unai Martinez-Corral <[email protected]>
1 parent 17a350a commit 0c77fb5

File tree

3 files changed

+41
-31
lines changed

3 files changed

+41
-31
lines changed

ci/action.sh

+37
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

+4-26
Original file line numberDiff line numberDiff line change
@@ -1,32 +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-
bash $GITHUB_ACTION_PATH/download_sdk.sh
20-
bash $GITHUB_ACTION_PATH/install.sh
21-
set -x
22-
if [ $SCRIPT ]; then
23-
bash $SCRIPT
24-
else
25-
bash $GITHUB_ACTION_PATH/script.sh
26-
fi
27-
if [ $? -eq 0 ]; then
28-
source $GITHUB_ACTION_PATH/after_success.sh
29-
else
30-
source $GITHUB_ACTION_PATH/after_failure.sh
31-
fi
32-
shell: bash
9+
- shell: bash
10+
run: $GITHUB_ACTION_PATH/action.sh

ci/download_sdk.sh

-5
This file was deleted.

0 commit comments

Comments
 (0)