-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (110 loc) · 3.76 KB
/
release.yml
File metadata and controls
134 lines (110 loc) · 3.76 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
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: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build release artifacts
runs-on: ubuntu-latest
strategy:
matrix:
goarch: [arm64, amd64]
include:
- goarch: arm64
abi: arm64-v8a
- goarch: amd64
abi: x86_64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Install Android NDK and build-tools
run: sdkmanager --install "ndk;27.0.12077973" "build-tools;35.0.0" "platforms;android-35"
- name: Build all artifacts
run: make dist magisk
env:
DIST_GOARCH: ${{ matrix.goarch }}
ANDROID_SDK: /usr/local/lib/android/sdk
DIST_NDK: /usr/local/lib/android/sdk/ndk/27.0.12077973
- name: Decode signing keystore
run: |
if [ -n "$JNISERVICE_KEYSTORE_B64" ]; then
echo "$JNISERVICE_KEYSTORE_B64" | base64 -d > build/release.keystore
fi
env:
JNISERVICE_KEYSTORE_B64: ${{ secrets.JNISERVICE_KEYSTORE_B64 }}
- name: Build APK
run: |
EXTRA_ENV=""
if [ -f build/release.keystore ]; then
export JNISERVICE_KEYSTORE=build/release.keystore
export JNISERVICE_KEYSTORE_PASSWORD="${KS_PASSWORD}"
fi
make apk
env:
DIST_GOARCH: ${{ matrix.goarch }}
ANDROID_SDK: /usr/local/lib/android/sdk
DIST_NDK: /usr/local/lib/android/sdk/ndk/27.0.12077973
KS_PASSWORD: ${{ secrets.JNISERVICE_KEYSTORE_PASSWORD }}
- name: Prepare release artifacts with descriptive names
run: |
mkdir -p release
TAG="${GITHUB_REF_NAME}"
ABI="${{ matrix.abi }}"
# CLI tool for Linux hosts
cp build/jnicli-linux-${{ matrix.goarch }} \
"release/jnicli-${TAG}-linux-${{ matrix.goarch }}"
# CLI tool for Android devices
cp build/jnicli-android-${{ matrix.goarch }} \
"release/jnicli-${TAG}-android-${ABI}"
# MCP server for Linux hosts
cp build/jnimcp-linux-${{ matrix.goarch }} \
"release/jnimcp-${TAG}-linux-${{ matrix.goarch }}"
# MCP server for Android devices
cp build/jnimcp-android-${{ matrix.goarch }} \
"release/jnimcp-${TAG}-android-${ABI}"
# Admin tool for Android devices
cp build/jniserviceadmin-android-${{ matrix.goarch }} \
"release/jniserviceadmin-${TAG}-android-${ABI}"
# APK installer (no root required)
cp build/jniservice-${ABI}.apk \
"release/jniservice-${TAG}-${ABI}.apk"
# Magisk module (rooted devices, auto-start on boot)
cp build/jniservice-magisk-${ABI}.zip \
"release/jniservice-magisk-${TAG}-${ABI}.zip"
ls -la release/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.goarch }}
path: release/
release:
name: Create GitHub release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: find artifacts -type f | sort
- name: Create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
artifacts/**/*