Skip to content

Commit 553e65e

Browse files
committed
Fix Arch Linux Artifact
1 parent d9af5b2 commit 553e65e

File tree

1 file changed

+37
-74
lines changed

1 file changed

+37
-74
lines changed

.github/workflows/linux_arch.yml

Lines changed: 37 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,8 @@ on:
1010
workflow_call:
1111

1212
jobs:
13-
setup:
14-
runs-on: ubuntu-22.04
15-
steps:
16-
- uses: actions/checkout@v4
17-
- name: Install Docker
18-
run: |
19-
sudo apt-get update
20-
sudo apt-get install -y docker.io
21-
sudo systemctl start docker
22-
sudo systemctl enable docker
23-
- name: Pull Arch Linux Docker Image
24-
run: |
25-
docker pull archlinux:latest
26-
- name: Create and Start Arch Linux Container
27-
run: |
28-
docker run -d --name archlinux_container -v ${{ github.workspace }}:/workspace -w /workspace archlinux:latest tail -f /dev/null
29-
- name: Install Dependencies in Arch Linux Container
30-
run: |
31-
docker exec archlinux_container bash -c "
32-
pacman -Syu --noconfirm &&
33-
pacman -S --noconfirm base-devel git npm
34-
"
35-
- name: Bundle WebUI Bridge
36-
run: |
37-
docker exec archlinux_container bash -c "
38-
npm i -g esbuild &&
39-
chmod +x bridge/build.sh &&
40-
./bridge/build.sh
41-
"
42-
- uses: actions/cache@v4
43-
with:
44-
path: bridge/webui_bridge.h
45-
key: ${{ runner.os }}-${{ github.sha }}-bridge
46-
4713
build:
48-
needs: setup
49-
runs-on: ubuntu-22.04
50-
permissions:
51-
contents: write
14+
runs-on: ubuntu-latest
5215
strategy:
5316
matrix:
5417
include:
@@ -59,72 +22,72 @@ jobs:
5922
fail-fast: false
6023
env:
6124
ARTIFACT: webui-linux-arch-${{ matrix.cc }}-${{ matrix.arch }}
62-
CC: ${{ matrix.cc }}
6325
steps:
64-
- uses: actions/checkout@v4
65-
- uses: actions/cache/restore@v4
66-
with:
67-
path: bridge/webui_bridge.h
68-
key: ${{ runner.os }}-${{ github.sha }}-bridge
69-
fail-on-cache-miss: true
70-
- name: Install Build Tools in Arch Linux Container
71-
run: |
72-
docker exec archlinux_container bash -c "
73-
if [ \"$CC\" == \"clang\" ]; then
74-
pacman -S --noconfirm clang
75-
else
76-
pacman -S --noconfirm gcc
77-
fi
78-
"
79-
- name: Build Debug Target
80-
run: |
81-
docker exec archlinux_container bash -c "make debug"
82-
- name: Build Release Target
83-
if: ${{ !cancelled() }}
84-
run: |
85-
docker exec archlinux_container bash -c "make"
86-
- name: Build TLS Debug Target
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 Arch Linux Docker Image
8733
run: |
88-
docker exec archlinux_container bash -c "make WEBUI_USE_TLS=1 debug"
89-
- name: Build TLS Release Target
34+
docker build -t archlinux:latest - <<EOF
35+
FROM archlinux:latest
36+
RUN pacman -Syu --noconfirm git npm make gcc clang llvm lld
37+
EOF
38+
39+
- name: Run build inside Arch Linux container
9040
run: |
91-
docker exec archlinux_container bash -c "make WEBUI_USE_TLS=1"
41+
docker run --rm \
42+
-v ${{ github.workspace }}:/workspace \
43+
-w /workspace \
44+
archlinux:latest \
45+
bash -c "
46+
npm i -g esbuild &&
47+
chmod +x bridge/build.sh &&
48+
./bridge/build.sh &&
49+
make debug &&
50+
make &&
51+
make WEBUI_USE_TLS=1 debug &&
52+
make WEBUI_USE_TLS=1
53+
"
54+
9255
- name: Prepare Artifact
9356
run: |
94-
docker exec archlinux_container bash -c "
95-
cp -r include dist &&
96-
mv dist/ \"$ARTIFACT\"
97-
"
57+
cp -r include dist
58+
mv dist/ "$ARTIFACT"
59+
9860
- name: Upload Artifact
9961
uses: actions/upload-artifact@v4
10062
with:
10163
name: ${{ env.ARTIFACT }}
10264
path: ${{ env.ARTIFACT }}
65+
10366
- name: Prepare Release
10467
if: >
10568
github.repository_owner == 'webui-dev'
10669
&& (github.ref_type == 'tag' || (github.ref_name == 'main' && github.event_name == 'push'))
10770
run: |
108-
docker exec archlinux_container bash -c "
109-
zip -r \"$ARTIFACT.zip\" \"$ARTIFACT\"
110-
"
71+
zip -r "$ARTIFACT.zip" "$ARTIFACT"
11172
if [ $GITHUB_REF_TYPE == tag ]; then
11273
echo "TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV
11374
else
11475
{
11576
echo "IS_PRERELEASE=true";
11677
echo "TAG=nightly";
117-
echo "TITLE=WebUI Nightly Build $(date -u +'%Y-%m-%d %H:%M:%S UTC')";
118-
echo "BODY=Generated from commit $GITHUB_SHA.";
78+
echo "TITLE=WebUI Nightly Build $(date -u +'%Y-%m-%d %H:%M:%S UTC')"
79+
echo "BODY=Generated from commit $GITHUB_SHA."
11980
} >> $GITHUB_ENV
12081
fi
82+
12183
- name: Update Nightly Tag
12284
if: env.IS_PRERELEASE
12385
uses: richardsimko/update-tag@v1
12486
env:
12587
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12688
with:
12789
tag_name: nightly
90+
12891
- name: Release
12992
if: >
13093
github.repository_owner == 'webui-dev'

0 commit comments

Comments
 (0)