-
-
Notifications
You must be signed in to change notification settings - Fork 2
142 lines (127 loc) · 3.82 KB
/
build-ndk.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
name: NDK build
on:
workflow_dispatch:
push:
tags:
- "v*"
branches:
- 'master'
- 'dev/*'
- 'feat/*'
- 'fix/*'
paths-ignore:
- '**.yml'
- '!.github/workflows/build-ndk.yml'
- '**.json'
- '!qpm.json'
- '!mod.template.json'
- '**.txt'
- '!CMakeLists.txt'
- '**.ps1'
- '!scripts/*.ps1'
- '**.md'
- '.gitignore'
pull_request:
branches:
- master
env:
module_id: songdetails
qmod_name: SongDetails
jobs:
build:
runs-on: ubuntu-latest
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- uses: actions/checkout@v4
name: Checkout
with:
submodules: true
lfs: true
- uses: seanmiddleditch/gha-setup-ninja@v5
- name: Get Protobuf from vcpkg
uses: johnwason/vcpkg-action@v6
id: vcpkg
with:
manifest-dir: ${{ github.workspace }}
triplet: arm64-android
# Disables fetch depth to ensure all history is available (fixes manifest mode)
fetch-depth: 0
token: ${{ github.token }}
github-binarycache: true
cache-key: 'vcpkg'
# get version from pushed tag
- name: Extract version
if: startsWith(github.ref, 'refs/tags/v')
id: version
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> ${GITHUB_OUTPUT}
# if we don't have a tag, don't do anything special
- name: Setup qpm
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
uses: Fernthedev/qpm-action@main
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}
restore: true
cache: true
publish: false
# if we have a tag, we are making a qpm release
- name: Setup qpm for release
if: startsWith(github.ref, 'refs/tags/v')
uses: Fernthedev/qpm-action@main
with:
workflow_token: ${{ secrets.GITHUB_TOKEN }}
restore: true
cache: true
publish: true
publish_token: ${{ secrets.QPM_KEY }}
version: ${{ steps.version.outputs.VERSION }}
tag: ${{ steps.version.outputs.TAG }}
qpm_release_bin: true
qpm_debug_bin: true
qpm_qmod: ${{ env.qmod_name }}.qmod
- name: Build & Create Qmod
run: |
cd ${GITHUB_WORKSPACE}
qpm s qmod
- name: Get Library Name
id: libname
run: |
cd ./build/
pattern="lib${module_id}*.so"
files=( $pattern )
echo "NAME=${files[0]}" >> ${GITHUB_OUTPUT}
- name: Rename debug artifact
run: mv "./build/debug/${{ steps.libname.outputs.NAME }}" "./build/debug_${{ steps.libname.outputs.NAME }}"
- name: Upload non-debug artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.libname.outputs.NAME }}
path: ./build/${{ steps.libname.outputs.NAME }}
if-no-files-found: error
- name: Upload debug artifact
uses: actions/upload-artifact@v4
with:
name: debug_${{ steps.libname.outputs.NAME }}
path: ./build/debug_${{ steps.libname.outputs.NAME }}
if-no-files-found: error
- name: Upload qmod artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.qmod_name}}.qmod
path: ./${{ env.qmod_name }}.qmod
if-no-files-found: error
# if we had a tag, we should make a release
- name: Upload release artifacts
if: startsWith(github.ref, 'refs/tags/v')
id: upload_file_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.version }}
files: |
./build/${{ steps.libname.outputs.NAME }}
./build/debug_${{ steps.libname.outputs.NAME }}
./${{ env.qmod_name }}.qmod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}