-
Notifications
You must be signed in to change notification settings - Fork 1.6k
134 lines (117 loc) · 4.48 KB
/
linux-musl.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: ci-linux-musl
on:
workflow_dispatch:
pull_request:
push:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04 # needs to be ubuntu-24.04 for qemu-user-static loongarch64 support
permissions:
contents: read
id-token: write
attestations: write
strategy:
fail-fast: false
matrix:
build_method: [python, cmake]
arch:
[
aarch64-linux-musl,
arm-linux-musleabi,
arm-linux-musleabihf,
armv6-linux-musleabihf,
armv7l-linux-musleabihf,
i686-linux-musl,
x86_64-linux-musl,
mips-linux-musl,
mips64-linux-musl,
mips64el-linux-musl,
mipsel-linux-musl,
powerpc-linux-musl,
powerpc64le-linux-musl,
s390x-linux-musl,
riscv64-linux-musl,
loongarch64-linux-musl,
]
include:
- arch: aarch64-linux-musl
build_method: [python, cmake]
binary_name: aarch64
- arch: arm-linux-musleabi
binary_name: armv5
- arch: arm-linux-musleabihf
binary_name: armhf
- arch: armv6-linux-musleabihf
binary_name: armv6
- arch: armv7l-linux-musleabihf
binary_name: armv7
- arch: i686-linux-musl
binary_name: x86
- arch: x86_64-linux-musl
binary_name: x86_64
- arch: mips-linux-musl
binary_name: mips
- arch: mips64-linux-musl
binary_name: mips64
- arch: mips64el-linux-musl
binary_name: mips64el
- arch: mipsel-linux-musl
binary_name: mipsel
- arch: powerpc-linux-musl
binary_name: powerpc
- arch: powerpc64le-linux-musl
binary_name: powerpc64le
- arch: s390x-linux-musl
binary_name: s390x
- arch: riscv64-linux-musl
binary_name: riscv64
- arch: loongarch64-linux-musl
binary_name: loongarch64
name: ${{ matrix.arch }}
steps:
- name: Host - checkout
uses: actions/checkout@v4
- name: Host - update
run: sudo apt-get update
- name: Host - set up qemu-user-static binfmt-support
run: sudo apt-get install libpipeline1 qemu-user-static binfmt-support
- name: Host - Create docker crossbuild container
run: docker run --name crossbuild -it -d -e "LDFLAGS=-s -static --static" -w /home/github -v ${{ github.workspace }}:/home/github ghcr.io/userdocs/qbt-musl-cross-make:${{ matrix.arch }}
- name: Docker - Install ninja build optional dependencies
run: |
docker exec crossbuild sudo apk update
docker exec crossbuild sudo apk add --no-cache gtest gtest-dev python3
- name: Docker - Configure ${{ matrix.binary_name }}
if: matrix.build_method == 'cmake'
run: >
docker exec crossbuild
cmake -B build
-D CMAKE_BUILD_TYPE="Release"
- name: Docker - Cmake Build ${{ matrix.binary_name }}
if: matrix.build_method == 'cmake'
run: docker exec crossbuild cmake --build build --parallel --config Release
- name: Docker - Python Build ${{ matrix.binary_name }}
if: matrix.build_method == 'python'
run: |
docker exec crossbuild ./configure.py --bootstrap --verbose
printf "%s\n" "build_method=-python" >> $GITHUB_ENV
- name: Host - Rename ${{ matrix.binary_name }} to ${{ env.release_asset }}
run: mv -f ${{ github.workspace }}/ninja ninja-${{ matrix.binary_name }}
- name: Host - ninja-${{ matrix.binary_name }} --version
run: ./ninja-${{ matrix.binary_name }}${{ env.build_method }} --version >> $GITHUB_STEP_SUMMARY
- name: Host - crossbuild binary info via file
run: file ./ninja-${{ matrix.binary_name }}${{ env.build_method }} >> $GITHUB_STEP_SUMMARY
- name: Host - signed build provenance attestations
uses: actions/attest-build-provenance@v2
with:
subject-path: ninja-${{ matrix.binary_name }}${{ env.build_method }}
- name: Upload artifact - ${{ matrix.binary_name }}
uses: actions/upload-artifact@v4
with:
name: ninja-${{ matrix.binary_name }}${{ env.build_method }}
path: ninja-${{ matrix.binary_name }}${{ env.build_method }}