forked from LunarG/gfxreconstruct
-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (150 loc) · 5.3 KB
/
sdk_android_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
145
146
147
148
149
150
151
152
153
154
155
156
name: SDK Android Build
# Perform an Android build, create a release, and attach build
# artifacts to the release when a Vulkan SDK tag is pushed. The
# Vulkan SDK does not include binaries for Android, so we publish
# them here to provide Android binaries built from the same source
# used to build the Vulkan SDK.
#
# The tag needs to be pushed by name, as `git push --tags` to push all
# tags does not appear to trigger the action.
#
# The Vulkan SDK release process is similar to the following:
# 1. Add a lightweight tag with the sdk version string.
# git tag sdk-1.2.141.0
# 3. Push the tag to GitHub.
# git push origin sdk-1.2.141.0
on:
push:
tags:
- sdk-*
jobs:
android:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Android Release/Debug",
os: ubuntu-latest,
artifact: "gfxreconstruct-android"
}
steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Update submodules
run: |
git submodule update --init
- name: Gradle build
run: |
cd android
sh gradlew assembleRelease assembleDebug
- name: Prepare artifacts
run: |
mkdir gfxreconstruct-dev
mkdir gfxreconstruct-dev/layer
mkdir gfxreconstruct-dev/tools
cp LICENSE.txt gfxreconstruct-dev/
cp LICENSE_ThirdParty.txt gfxreconstruct-dev/
cp USAGE_android.md gfxreconstruct-dev/
cp layer/vk_layer_settings.txt gfxreconstruct-dev/
cp -r android/layer/build/intermediates/cmake/release/obj/arm64-v8a gfxreconstruct-dev/layer/
cp -r android/layer/build/intermediates/cmake/release/obj/armeabi-v7a gfxreconstruct-dev/layer/
cp android/tools/replay/build/outputs/apk/debug/replay-debug.apk gfxreconstruct-dev/tools/
cp android/scripts/gfxrecon.py gfxreconstruct-dev/tools/
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./gfxreconstruct-dev
release:
name: Create Release for Tag
runs-on: ubuntu-latest
needs: android
steps:
- name: Get sdk version string
id: get_sdk_version
run: |
sdk_version=`echo "${{ github.ref }}" | cut -d "-" -f 2`
echo "::set-output name=sdk_version::$sdk_version"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Android binaries for ${{ steps.get_tag_body.outputs.sdk_version }} SDK release
body: |
Android binaries to compliment the desktop binaries distributed with the Vulkan ${{ steps.get_tag_body.outputs.sdk_version }} SDK.
Build Info:
- Android SDK Version: 27 (Android 8.1)
- Android NDK Version: 21.3.6528147 (r21d)
draft: false
prerelease: false
- name: Get release URL
run: |
echo "${{ steps.create_release.outputs.upload_url }}" > ./release_url
- name: Upload release URL
uses: actions/upload-artifact@v1
with:
name: release_url
path: ./release_url
publish:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: release
strategy:
fail-fast: false
matrix:
config:
- {
name: "Upload Android Release Tar Gzip Artifact",
os: ubuntu-latest,
artifact: "gfxreconstruct-android",
command: "tar czf",
suffix: "android.tar.gz",
type: "application/x-gtar"
}
- {
name: "Upload Android Release Zip Artifact",
os: ubuntu-latest,
artifact: "gfxreconstruct-android",
command: "zip -r",
suffix: "android.zip",
type: "application/zip"
}
steps:
- name: Get tag name
id: get_tag_name
run: |
tag_name=`echo "${{ github.ref }}" | cut -d "/" -f 3`
echo "::set-output name=tag_name::$tag_name"
- name: Download artifacts
uses: actions/download-artifact@v1
with:
name: ${{ matrix.config.artifact }}
path: ./gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}
- name: Make release artifacts
run: |
${{ matrix.config.command }} gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}-${{ matrix.config.suffix }} gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}
- name: Download release URL
uses: actions/download-artifact@v1
with:
name: release_url
path: ./
- name: Set upload URL
id: set_upload_url
run: |
upload_url=`cat ./release_url`
echo "::set-output name=upload_url::$upload_url"
- name: Upload release artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
asset_name: gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}-${{ matrix.config.suffix }}
asset_path: ./gfxreconstruct-${{ steps.get_tag_name.outputs.tag_name }}-${{ matrix.config.suffix }}
asset_content_type: ${{ matrix.config.type }}