1010 workflow_call :
1111
1212jobs :
13- setup :
14- runs-on : rhel-8
15- steps :
16- - uses : actions/checkout@v4
17- - name : Install Dependencies
18- run : |
19- sudo dnf install -y npm
20- - name : Bundle WebUI Bridge
21- run : |
22- npm i -g esbuild
23- chmod +x bridge/build.sh
24- bridge/build.sh
25- - uses : actions/cache@v4
26- with :
27- path : bridge/webui_bridge.h
28- key : ${{ runner.os }}-${{ github.sha }}-bridge
29-
3013 build :
31- needs : setup
32- runs-on : rhel-8
33- permissions :
34- contents : write
14+ runs-on : ubuntu-latest
3515 strategy :
3616 matrix :
3717 include :
@@ -42,56 +22,52 @@ jobs:
4222 fail-fast : false
4323 env :
4424 ARTIFACT : webui-linux-redhat-${{ matrix.cc }}-${{ matrix.arch }}
45- CC : ${{ matrix.cc }}
4625 steps :
47- - uses : actions/checkout@v4
48- - uses : actions/cache/restore @v4
49- with :
50- path : bridge/webui_bridge.h
51- key : ${{ runner.os }}-${{ github.sha }}-bridge
52- fail-on-cache-miss : true
53- - name : Install Build Tools
26+ - name : Check out the repository
27+ uses : actions/checkout @v4
28+
29+ - name : Set up Docker Buildx
30+ uses : docker/setup-buildx-action@v2
31+
32+ - name : Build RedHat Docker Image
5433 run : |
55- sudo dnf install -y $CC make
56- if [ "$CC" == "clang" ]; then
57- sudo dnf install -y llvm llvm-libs llvm-devel
58- fi
59- - name : Build Debug Target
60- run : make debug
61- - name : Build Release Target
62- if : ${{ !cancelled() }}
63- run : make
64- - name : Build TLS Debug Target
65- run : make WEBUI_USE_TLS=1 debug
66- - name : Build TLS Release Target
67- run : make WEBUI_USE_TLS=1
68- - name : Build Examples
34+ docker build -t redhat:latest - <<EOF
35+ FROM almalinux:9
36+ RUN dnf install -y epel-release
37+ RUN dnf groupinstall -y "Development Tools"
38+ RUN dnf install -y git nodejs npm clang llvm-toolset lld
39+ EOF
40+
41+ - name : Run build inside RedHat container
6942 run : |
70- examples_base_dir=$(pwd)/examples/C
71- for example in $(find $examples_base_dir/* -maxdepth 0 -type d); do
72- echo "> $example"
73- cd $example || (exit_code=1 && continue)
74- if ! make; then
75- echo "Failed to build '$example'"
76- exit_code=1
77- continue
78- fi
79- if [[ ! -e "main" || ! -e "main-dyn" ]] ; then
80- echo "Failed to find executable for '$example'" && find .
81- exit_code=1
82- continue
83- fi
84- done
85- exit $exit_code
43+ docker run --rm \
44+ -v ${{ github.workspace }}:/workspace \
45+ -w /workspace \
46+ --user root \
47+ redhat:latest \
48+ bash -c "
49+ git config --global --add safe.directory /workspace &&
50+ npm i -g esbuild &&
51+ chmod +x bridge/build.sh &&
52+ ./bridge/build.sh &&
53+ make debug &&
54+ make &&
55+ make WEBUI_USE_TLS=1 debug &&
56+ make WEBUI_USE_TLS=1 &&
57+ chown -R $(id -u):$(id -g) /workspace
58+ "
59+
8660 - name : Prepare Artifact
8761 run : |
8862 cp -r include dist
8963 mv dist/ "$ARTIFACT"
64+
9065 - name : Upload Artifact
9166 uses : actions/upload-artifact@v4
9267 with :
9368 name : ${{ env.ARTIFACT }}
9469 path : ${{ env.ARTIFACT }}
70+
9571 - name : Prepare Release
9672 if : >
9773 github.repository_owner == 'webui-dev'
@@ -108,13 +84,15 @@ jobs:
10884 echo "BODY=Generated from commit $GITHUB_SHA."
10985 } >> $GITHUB_ENV
11086 fi
87+
11188 - name : Update Nightly Tag
11289 if : env.IS_PRERELEASE
11390 uses : richardsimko/update-tag@v1
11491 env :
11592 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11693 with :
11794 tag_name : nightly
95+
11896 - name : Release
11997 if : >
12098 github.repository_owner == 'webui-dev'
@@ -126,4 +104,4 @@ jobs:
126104 body : ${{ env.BODY }}
127105 name : ${{ env.TITLE }}
128106 prerelease : ${{ env.IS_PRERELEASE }}
129- allowUpdates : true
107+ allowUpdates : true
0 commit comments