Skip to content

Commit 3dcde28

Browse files
committed
CI: Multi-arch compilation
1 parent fee91cc commit 3dcde28

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/compile.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build and Release mod_antiloris
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- arch: x86_64
18+
platform: linux/amd64
19+
arch_label: x86_64
20+
- arch: armv7
21+
platform: linux/arm/v7
22+
arch_label: armv7
23+
- arch: aarch64
24+
platform: linux/arm64
25+
arch_label: aarch64
26+
- arch: ppc64le
27+
platform: linux/ppc64le
28+
arch_label: ppc64le
29+
- arch: s390x
30+
platform: linux/s390x
31+
arch_label: s390x
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v3
35+
36+
- name: Get OS Name and Version
37+
run: |
38+
source /etc/os-release
39+
echo "OS_ID=$ID" >> $GITHUB_ENV
40+
echo "OS_VERSION_ID=$VERSION_ID" >> $GITHUB_ENV
41+
42+
- name: Set up QEMU
43+
uses: docker/setup-qemu-action@v2
44+
45+
- name: Build for ${{ matrix.arch }}
46+
run: |
47+
docker run --rm --privileged --platform ${{ matrix.platform }} \
48+
-v ${{ github.workspace }}:/src -w /src ${{ env.OS_ID }}:${{ env.OS_VERSION_ID }} bash -c "
49+
apt-get update && \
50+
apt-get install -y git apache2-dev cmake gcc make && \
51+
git config --global --add safe.directory /src && \
52+
mkdir -p build && cd build && \
53+
cmake .. && make mod_antiloris && \
54+
cp mod_antiloris.so /src/mod_antiloris-${{ matrix.arch_label }}.so
55+
"
56+
57+
- name: Upload artifact
58+
uses: actions/upload-artifact@v3
59+
with:
60+
name: mod_antiloris-${{ matrix.arch_label }}
61+
path: mod_antiloris-${{ matrix.arch_label }}.so
62+
63+
- name: Upload release asset
64+
if: startsWith(github.ref, 'refs/tags/')
65+
uses: softprops/action-gh-release@v1
66+
with:
67+
files: mod_antiloris-${{ matrix.arch_label }}.so
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)