Skip to content

Commit 0a256ab

Browse files
committed
update ci
1 parent 798b4dc commit 0a256ab

1 file changed

Lines changed: 6 additions & 95 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 6 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3,112 +3,23 @@ name: CMake
33
on:
44
push:
55

6-
env:
7-
BUILD_TYPE: Release
8-
96
jobs:
107
build:
118
runs-on: ubuntu-latest
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
abi: ["x86_64", "arm64-v8a", "x86", "armeabi-v7a" ]
16-
include:
17-
- abi: x86_64
18-
ndktarget: x86_64-linux-android-
19-
- abi: x86
20-
ndktarget: i686-linux-android-
21-
- abi: armeabi-v7a
22-
openssltarget: android-arm
23-
ndktarget: arm-linux-androideabi-
24-
- abi: arm64-v8a
25-
openssltarget: android-arm64
26-
ndktarget: aarch64-linux-android-
279
steps:
2810
- run: sudo apt update && sudo apt install llvm g++ ninja-build
29-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v6
3012
- uses: nttld/setup-ndk@v1
3113
id: setup-ndk
3214
with:
3315
ndk-version: r21e
3416
add-to-path: true
35-
- uses: actions/checkout@v2
36-
with:
37-
repository: "openssl/openssl"
38-
ref: master
39-
path: openssl
40-
41-
- name: Configure and build Openssl
42-
run: |
43-
export PATH="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/:$PATH"
44-
./Configure -latomic ${{ matrix.openssltarget || format('android-{0}', matrix.abi) }} && make build_libs
45-
env:
46-
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
47-
LD: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/${{matrix.ndktarget}}ld
48-
RANLIB: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/${{matrix.ndktarget}}ranlib
49-
working-directory: ${{github.workspace}}/openssl
50-
51-
- uses: actions/upload-artifact@v2
52-
with:
53-
name: openssl-${{format('android-{0}', matrix.abi)}}
54-
path: |
55-
openssl/libssl.so
56-
openssl/libcrypto.so
57-
- uses: actions/checkout@v2
58-
with:
59-
repository: "protocolbuffers/protobuf"
60-
ref: 3.18.x
61-
path: protobuf
62-
submodules: recursive
63-
- name: Configure Protobuf
64-
run: cmake -B ${{github.workspace}}/buildprotobuf -S protobuf/cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.abi }} -Dprotobuf_BUILD_TESTS=OFF
65-
- name: Build Protobuf
66-
run: cmake --build ${{github.workspace}}/buildprotobuf --config ${{env.BUILD_TYPE}} --target libprotobuf
67-
- name: Configure Protoc
68-
run: cmake -B ${{github.workspace}}/buildprotobufhost -S protobuf/cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -Dprotobuf_BUILD_TESTS=OFF
69-
- name: Build Protoc
70-
run: cmake --build ${{github.workspace}}/buildprotobufhost --config ${{env.BUILD_TYPE}} --target protoc
71-
- name: Configure
72-
run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake -DANDROID_ABI=${{ matrix.abi }} "-DProtobuf_SRC_ROOT_FOLDER=${{github.workspace}}/protobuf/src" "-DProtobuf_INCLUDE_DIR=${{github.workspace}}/protobuf/src" "-DProtobuf_PROTOC_EXECUTABLE=${{github.workspace}}/buildprotobufhost/protoc" "-DProtobuf_LIBRARY=${{github.workspace}}/buildprotobuf/libprotobuf.a" "-DOPENSSL_SSL_LIBRARY=${{github.workspace}}/openssl/libssl.so" "-DOPENSSL_CRYPTO_LIBRARY=${{github.workspace}}/openssl/libcrypto.so" "-DOPENSSL_INCLUDE_DIR=${{github.workspace}}/openssl/include" "-DCMAKE_CXX_FLAGS=-Wl,--strip-all -fvisibility=hidden"
7317
- name: Build
74-
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target mcpelauncherupdates
18+
run: |
19+
make release_zips
7520
76-
- uses: actions/upload-artifact@v2
21+
- uses: actions/upload-artifact@v7
7722
with:
78-
name: update-${{format('android-{0}', matrix.abi)}}
23+
name: mods
7924
path: |
80-
build/libmcpelauncherupdates.so
81-
deploy:
82-
needs: build
83-
name: Deploy to mcpelauncher-updates-bin
84-
runs-on: ubuntu-latest
85-
steps:
86-
- uses: webfactory/ssh-agent@v0.5.3
87-
with:
88-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
89-
- name: setup git
90-
run: |
91-
git config --global user.email "action@github.com"
92-
git config --global user.name "GitHub Action"
93-
- uses: actions/download-artifact@v2
94-
with:
95-
path: "artifacts"
96-
- run: |
97-
shopt -s globstar
98-
git clone git@github.com:minecraft-linux/mcpelauncher-updates-bin.git mcpelauncher-updates-bin
99-
rm mcpelauncher-updates-bin/*/*.so || :
100-
git -C mcpelauncher-updates-bin checkout armeabi-v7a/libmodloader.so || :
101-
git -C mcpelauncher-updates-bin checkout arm64-v8a/libmodloader.so || :
102-
mkdir -p mcpelauncher-updates-bin/x86
103-
cp artifacts/*-x86/*.so mcpelauncher-updates-bin/x86/
104-
mkdir -p mcpelauncher-updates-bin/x86_64
105-
cp artifacts/*-x86_64/*.so mcpelauncher-updates-bin/x86_64/
106-
mkdir -p mcpelauncher-updates-bin/armeabi-v7a
107-
cp artifacts/*-armeabi-v7a/*.so mcpelauncher-updates-bin/armeabi-v7a/
108-
mkdir -p mcpelauncher-updates-bin/arm64-v8a
109-
cp artifacts/*-arm64-v8a/*.so mcpelauncher-updates-bin/arm64-v8a/
110-
patchelf --set-rpath \$ORIGIN mcpelauncher-updates-bin/armeabi-v7a/*.so mcpelauncher-updates-bin/arm64-v8a/*.so
111-
pushd mcpelauncher-updates-bin
112-
git add .
113-
git commit -m "Deploy"
114-
git push
25+
out/*.zip

0 commit comments

Comments
 (0)