forked from leleliu008/ndk-pkg-package-manually-build
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (114 loc) · 4.09 KB
/
manually-build.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
135
136
137
138
139
140
141
142
143
144
name: manually build ndk-pkg packages
on:
workflow_dispatch:
inputs:
package-name:
description: input the package name to be built
required: true
default: zlib
target-api:
description: choose the min sdk api level to be built with
type: choice
options:
- '35'
- '34'
- '33'
- '32'
- '31'
- '30'
- '29'
- '28'
- '27'
- '26'
- '25'
- '24'
- '23'
- '22'
- '21'
target-abis:
description: input android abis to be built for
required: true
default: arm64-v8a,armeabi-v7a,x86_64,x86
build-type:
description: choose a build profile
type: choice
options:
- release
- debug
pack-type:
description: choose a pack type
type: choice
options:
- tar.xz
- tar.lz
- tar.gz
- tar.bz2
- zip
log-level:
description: choose a log-level
type: choice
options:
- ''
- '-q'
- '-v'
- '-vv'
static:
description: create fully statically linked executables
type: boolean
default: false
generate-maven-repo:
description: generate maven local repository bundle
type: boolean
default: false
maven-group-id:
description: input the maven groupId, default is com.fpliu.ndk.pkg.prefab.android.<API>
jobs:
build:
runs-on: ubuntu-latest
container: ubuntu:24.04
steps:
- run: apt -y update
- run: apt -y install curl
- run: curl -LO https://raw.githubusercontent.com/leleliu008/ndk-pkg/master/ndk-pkg
- run: chmod +x ndk-pkg
- run: ./ndk-pkg about
- run: ./ndk-pkg setup
- run: ./ndk-pkg sysinfo
- run: ./ndk-pkg update
- if: ${{ github.event.inputs.static == 'true' }}
run: ./ndk-pkg install android-${{ github.event.inputs.target-api }}-${{ github.event.inputs.target-abis }}/${{ github.event.inputs.package-name }} --profile=${{ github.event.inputs.build-type }} ${{ github.event.inputs.log-level }} --static
- if: ${{ github.event.inputs.static == 'false' }}
run: ./ndk-pkg install android-${{ github.event.inputs.target-api }}-${{ github.event.inputs.target-abis }}/${{ github.event.inputs.package-name }} --profile=${{ github.event.inputs.build-type }} ${{ github.event.inputs.log-level }}
- name: pack
run: |
set -ex
for item in $(./ndk-pkg ls-installed)
do
./ndk-pkg pack "$item" -t ${{ github.event.inputs.pack-type }}
done
- if: ${{ github.event.inputs.generate-maven-repo == 'true' }}
name: generate maven local repository
run: |
set -ex
export NDKPKG_XTRACE=1
GROUPID='${{ github.event.inputs.maven-group-id }}'
[ -z "$GROUPID" ] && GROUPID='com.fpliu.ndk.pkg.prefab.android.${{ github.event.inputs.target-api }}'
ABIS="${{ github.event.inputs.target-abis }}"
ABI="${ABIS%%,*}"
for PKGNAME in $(./ndk-pkg ls-installed | cut -d/ -f2 | sort | uniq)
do
if [ -d "$HOME/.ndk-pkg/installed/android-${{ github.event.inputs.target-api }}-$ABI/$PKGNAME/include" ] ; then
./ndk-pkg deploy android-${{ github.event.inputs.target-api }}-${{ github.event.inputs.target-abis }}/$PKGNAME --local=maven-local-repository-bundle --groupId="$GROUPID"
else
echo "no dev files."
fi
done
if [ -d maven-local-repository-bundle ] ; then
tar cJvf maven-local-repository-bundle.tar.xz maven-local-repository-bundle
fi
- run: ls
- run: du -sh *.tar.xz
- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.inputs.package-name }}-android${{ github.event.inputs.target-api }}-${{ github.event.inputs.target-abis }}
path: ${{ github.workspace }}/*.tar.xz