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