-
Notifications
You must be signed in to change notification settings - Fork 236
123 lines (104 loc) · 3.54 KB
/
android.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
# Copyright 2015-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0
name: KTX-Software Android CI
# Seems no way to avoid duplicating this on logic in each .yml file.
# See https://github.com/actions/starter-workflows/issues/245.
on:
# Trigger the workflow on a pull request,
pull_request:
push:
# And on pushes to main, which will occur when a PR is merged.
branches:
- main
# Also trigger on push of release tags to any branch. Useful
# for testing release builds before merging to main.
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
paths-ignore:
- .appveyor.yml
- .travis.yml
# Allow manual trigger
workflow_dispatch:
jobs:
linux:
runs-on: ubuntu-latest
env:
GIT_LFS_SKIP_SMUDGE: 1
WERROR: ON
steps:
- uses: actions/checkout@v4
with:
# Fetch all history to make sure tags are
# included (used for version creation)
fetch-depth: 0
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
add-to-path: false
- name: Force fetch provoking tag's annotation.
# Work around https://github.com/actions/checkout/issues/290.
if: github.ref_type == 'tag'
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}
- name: Install Ninja
run: sudo apt-get install -y ninja-build
- name: android_Debug_arm64-v8a
run: ./scripts/build_android.sh
env:
ANDROID_ABI: arm64-v8a
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
ASTCENC_ISA: "ASTCENC_ISA_NEON=ON"
CONFIGURATION: Debug
- name: android_arm64-v8a
run: ./scripts/build_android.sh
env:
ANDROID_ABI: arm64-v8a
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
ASTCENC_ISA: "ASTCENC_ISA_NEON=ON"
CONFIGURATION: Release
# Android ABI x86 is obsolete
# and not supported by ARM ASTC encoder
# - name: android_x86
# run: ./scripts/build_android.sh
# env:
# ANDROID_ABI: x86
# ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: android_x86_64
run: ./scripts/build_android.sh
env:
ANDROID_ABI: x86_64
ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: get-version
id: ktx-version
run: |
KTX_VERSION=$(cat build-android-arm64-v8a/ktx.version)
echo "KTX_VERSION=$KTX_VERSION" >> $GITHUB_ENV
# Android artifact
# Zips the include and lib dirs installed for each architecture
# by the preceding steps and uploads the zip.
- name: upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: KTX-Software-${{env.KTX_VERSION}}-Android
path: install-android
# Make an archive to be deployed.
# Although the preceding step made an archive, Actions helpfully :-(
# unarchives the files on download.
- name: Create zip for deployment.
if: github.event_name == 'push' && github.ref_type == 'tag'
run: |
zip_basename=KTX-Software-${KTX_VERSION}-Android
ln -s install-android $zip_basename
zip -r $zip_basename.zip $zip_basename
sha1sum $zip_basename.zip > $zip_basename.zip.sha1
- name: Upload To Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && github.ref_type == 'tag'
with:
draft: true
prerelease: true
files: KTX-Software-${{env.KTX_VERSION}}-Android.zip*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}