-
Notifications
You must be signed in to change notification settings - Fork 15
95 lines (87 loc) · 3.68 KB
/
release.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
name: release
#on: [push, pull_request]
on:
push:
tags:
- '*'
jobs:
setup:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: get-version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
android:
runs-on: ubuntu-latest
env:
VALGRIND_VERSION: 3.17.0
PACKAGENAME: valgrind-3.17.0-android
steps:
- uses: actions/checkout@v2
- name: ndk-fix-debug
run: sed -i -e '/^ -g$/d' $ANDROID_HOME/ndk-bundle/build/cmake/android.toolchain.cmake
- name: valgrind-source
run: |
wget -q https://sourceware.org/pub/valgrind/valgrind-${{ env.VALGRIND_VERSION }}.tar.bz2
tar -xf valgrind-${{ env.VALGRIND_VERSION }}.tar.bz2
cd valgrind-${{ env.VALGRIND_VERSION }}
patch -p1 -i ../valgrind-3.16.1-ndk-r19-minimal_setjmp.patch
patch -p1 -i ../valgrind-3.16.1-fix-build-new-ndk.patch
- name: build-arm64-v8a
run: |
cd valgrind-${{ env.VALGRIND_VERSION }}
export AR=$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar
export LD=$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld
export CC=$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
export CPPFLAGS="-O3 --target=aarch64-none-linux-android21 --gcc-toolchain=$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot"
export CFLAGS="-O3 --target=aarch64-none-linux-android21 --gcc-toolchain=$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot"
./configure --prefix=/data/local/tmp/valgrind --host=aarch64-unknown-linux --target=aarch64-unknown-linux --with-tmpdir=/data/local/tmp
make -j2
make install DESTDIR=`pwd`/install
- name: strip-debug
run: |
cd valgrind-${{ env.VALGRIND_VERSION }}/install
find . -type f | xargs -i sh -c "$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip -g {} || true"
- name: package
run: |
mkdir ${{ env.PACKAGENAME }}
cp -rf valgrind-${{ env.VALGRIND_VERSION }}/install/data/local/tmp/valgrind ${{ env.PACKAGENAME }}/
rm -rf ${{ env.PACKAGENAME }}/valgrind/include
rm -rf ${{ env.PACKAGENAME }}/valgrind/share
rm -rf ${{ env.PACKAGENAME }}/valgrind/lib
zip -9 -r ${{ env.PACKAGENAME }}.zip ${{ env.PACKAGENAME }}
- name: upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}.zip
release:
needs: [setup, android]
runs-on: ubuntu-latest
steps:
- name: download
uses: actions/download-artifact@v2
with:
path: artifacts
- name: create-release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.setup.outputs.VERSION }}
release_name: Release ${{ needs.setup.outputs.VERSION }}
draft: false
prerelease: false
- name: upload-android
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGENAME: valgrind-3.17.0-android
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/${{ env.PACKAGENAME }}/${{ env.PACKAGENAME }}.zip
asset_name: ${{ env.PACKAGENAME }}.zip
asset_content_type: application/zip