-
Notifications
You must be signed in to change notification settings - Fork 668
72 lines (61 loc) · 1.98 KB
/
Copy pathbuild-native.yml
File metadata and controls
72 lines (61 loc) · 1.98 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
71
72
name: Build Native
on:
workflow_dispatch:
jobs:
matrix:
name: Build matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v7
- name: Build matrix from Makefile
id: set-matrix
# parse the Makefile to retrieve the list of targets in 'native-all', without 'native'
run: |
matrix=$((
echo '{ "target" : ['
sed -n "/^native-all *: */ { s///; p }" Makefile | sed "s/^native\s//g" | sed 's/ /, /g' | xargs -n 1 echo | sed -r 's/^([^,]*)(,?)$/"\1"\2/'
echo " ]}"
) | jq -c .)
echo $matrix | jq .
echo "matrix=$matrix" >> $GITHUB_OUTPUT
build:
name: Build native libraries
runs-on: ubuntu-latest
needs: [ matrix ]
strategy:
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
fail-fast: false
steps:
- uses: actions/checkout@v7
# Delete existing libs so we only upload the generated one into the artifact
- name: Delete existing native libs
run: rm -fr src/main/resources/org/sqlite/native
- name: Build native libraries
run: make ${{ matrix.target }}
env:
OCI_EXE: docker
- name: Upload native libraries
uses: actions/upload-artifact@v7
with:
name: native-libs-${{ matrix.target }}
path: src/main/resources/org/sqlite/native/
push:
name: Push new native libraries to branch
runs-on: ubuntu-latest
needs: [ build ]
steps:
- uses: actions/checkout@v7
- name: Download native libraries
uses: actions/download-artifact@v8
with:
pattern: native-libs-*
merge-multiple: true
path: src/main/resources/org/sqlite/native/
- run: git status
- name: Commit and push
uses: EndBug/add-and-commit@v10
with:
message: 'chore: update native libraries'
default_author: github_actions