-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (62 loc) · 2.02 KB
/
alpine_build.yml
File metadata and controls
70 lines (62 loc) · 2.02 KB
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
name: Alpine Build
on:
workflow_call:
inputs:
ring-version:
required: true
type: string
jobs:
build:
runs-on: ${{ matrix.arch == 'amd64' && 'ubuntu-latest' || 'ubuntu-24.04-arm' }}
strategy:
matrix:
include:
- arch: amd64
- arch: arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Clone Ring Language
uses: actions/checkout@v4
with:
repository: ringpackages/ringsrc
path: ring
ref: ${{ inputs.ring-version }}
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
cargo-cache
src/rust_src/target
key: alpine-${{ matrix.arch }}-cargo-${{ hashFiles('src/rust_src/Cargo.lock') }}
restore-keys: |
alpine-${{ matrix.arch }}-cargo-
- name: Build in Alpine container
run: |
mkdir -p cargo-cache
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-v ${{ github.workspace }}/cargo-cache:/root/.cargo \
-w /workspace \
alpine:3.23 sh -c '
apk add --no-cache cmake make gcc g++ musl-dev rust cargo curl python3 python3-dev clang clang-dev ninja git linux-headers
cd ring/language
cmake . -DCMAKE_BUILD_TYPE=Release -GNinja
ninja install
cd ../..
export RING=/workspace/ring
cd src/rust_src
cargo build --release
chmod -R a+r /root/.cargo /workspace/src/rust_src/target
'
- name: Copy Rust artifacts to lib directory
run: |
mkdir -p lib/linux/musl/${{ matrix.arch }}
cp src/rust_src/target/release/libring_python.so src/rust_src/target/release/libring_python_impl.so lib/linux/musl/${{ matrix.arch }}/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ring-python-linux-musl-${{ matrix.arch }}
path: lib/linux/musl/${{ matrix.arch }}/