forked from touchHLE/touchHLE
-
Notifications
You must be signed in to change notification settings - Fork 0
192 lines (184 loc) · 7.22 KB
/
touchHLE_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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Build touchHLE
on:
push:
branches: [ "trunk" ]
pull_request:
branches: [ "trunk" ]
env:
CARGO_TERM_COLOR: always
jobs:
# build-osx:
#
# # TODO: Use macos-latest once AArch64 cross-compile for x86_64 works
# runs-on: macos-12
#
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0 # touchHLE's git-describe versioning needs tag history
# - name: Install clang-format
# run: brew install clang-format
# - name: Check formatting
# run: dev-scripts/format.sh --check
# - name: Get Submodules
# run: git submodule update --init
# - name: Install Boost
# run: brew install boost
# # This is the earliest point at which we can do linting: clippy will end up
# # building dynarmic, which needs Boost, but we don't need LLVM until
# # building tests.
# - name: Lint
# run: dev-scripts/lint.sh
# - name: Try to get cached copy of LLVM
# id: cache-llvm
# uses: actions/cache@v3
# with:
# path: tests/llvm
# key: llvm_12_0_0_macOS_x64
# - if: ${{ steps.cache-llvm.outputs.cache-hit != 'true' }}
# name: Download LLVM
# run: curl -L -O "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz"
# - if: ${{ steps.cache-llvm.outputs.cache-hit != 'true' }}
# name: Extract LLVM
# run: tar -xf clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz && mkdir tests/llvm && mv clang+llvm-12.0.0-x86_64-apple-darwin/* tests/llvm
# - name: Test
# run: cargo test
# - name: Build
# run: cargo build --release && mv target/release/touchHLE .
# - uses: actions/upload-artifact@v3
# with:
# name: touchHLE_macOS_x86_64
# path: touchHLE
# - uses: actions/upload-artifact@v3
# with:
# name: TestApp_built_on_macOS
# path: tests/TestApp.app
#
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # touchHLE's git-describe versioning needs tag history
- name: Check formatting
run: dev-scripts/format.sh --check
- name: Get Submodules
run: git submodule update --init
- name: Try to get cached copy of Boost
id: cache-boost
uses: actions/cache@v3
with:
path: vendor/boost
key: boost_1_81_0
- if: ${{ steps.cache-boost.outputs.cache-hit != 'true' }}
name: Download Boost
run: curl -L -o boost_1_81_0.7z "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.7z"
- if: ${{ steps.cache-boost.outputs.cache-hit != 'true' }}
name: Extract Boost
run: 7z -ovendor x boost_1_81_0.7z && mv vendor/boost_1_81_0 vendor/boost
- name: Install AArch64 Android Rust toolchain
run: rustup target add aarch64-linux-android
- name: Install cargo-ndk
run: cargo install cargo-ndk
# Gradle version compatibility is a nightmare and we refuse to use gradlew.
- name: Try to get a cached copy of Gradle
id: cache-gradle
uses: actions/cache@v3
with:
path: gradle
key: gradle-7.3
- if: ${{ steps.cache-gradle.outputs.cache-hit != 'true' }}
name: Download Gradle
run: curl -L -o gradle-7.3-bin.zip "https://services.gradle.org/distributions/gradle-7.3-bin.zip"
- if: ${{ steps.cache-gradle.outputs.cache-hit != 'true' }}
name: Extract Gradle
run: 7z -ogradle x gradle-7.3-bin.zip
# We need to install the correct version of Android NDK manually
- name: Try to get a cached copy of Android NDK
id: cache-android-ndk
uses: actions/cache@v3
with:
path: android-ndk
key: android-ndk-r25c
- if: ${{ steps.cache-android-ndk.outputs.cache-hit != 'true' }}
name: Download Android NDK
run: curl -L -o android-ndk-r25c-linux.zip "https://dl.google.com/android/repository/android-ndk-r25c-linux.zip"
- if: ${{ steps.cache-android-ndk.outputs.cache-hit != 'true' }}
name: Extract Android NDK
run: 7z -oandroid-ndk x android-ndk-r25c-linux.zip
- name: Link Android NDK
run: ln -s $PWD'/android-ndk/android-ndk-r25c' $ANDROID_SDK_ROOT'/ndk/25.2.9519653'
# Why isn't there a command for this?
- name: Generate local.properties file
run: echo 'sdk.dir='$ANDROID_SDK_ROOT > android/local.properties
- name: Lint
run: dev-scripts/lint.sh ndk -t arm64-v8a
env:
# The version should match the ndkVersion defined in `android\app\build.gradle`
ANDROID_NDK_ROOT: '/usr/local/lib/android/sdk/ndk/25.2.9519653'
ANDROID_NDK: '/usr/local/lib/android/sdk/ndk/25.2.9519653'
ANDROID_NDK_HOME: '/usr/local/lib/android/sdk/ndk/25.2.9519653'
# Don't attempt to run tests (can't run on Android).
- name: Build for Android
run: cd android && ../gradle/gradle-7.3/bin/gradle assembleRelease && mv app/build/outputs/apk/release/app-release.apk ../touchHLE.apk
env:
# The version should match the ndkVersion defined in `android\app\build.gradle`
ANDROID_NDK_ROOT: '/usr/local/lib/android/sdk/ndk/25.2.9519653'
- uses: actions/upload-artifact@v3
with:
name: touchHLE_Android_AArch64
path: touchHLE.apk
build-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # touchHLE's git-describe versioning needs tag history
# Apparently the Windows runner already has clang-format? That's nice.
- name: Check formatting
shell: bash # no command output without this
run: dev-scripts/format.sh --check
- name: Get Submodules
run: git submodule update --init
- name: Try to get cached copy of Boost
id: cache-boost
uses: actions/cache@v3
with:
path: vendor\boost
key: boost_1_81_0
- if: ${{ steps.cache-boost.outputs.cache-hit != 'true' }}
name: Download Boost
run: curl -L -o boost_1_81_0.7z "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.7z"
- if: ${{ steps.cache-boost.outputs.cache-hit != 'true' }}
name: Extract Boost
run: 7z -ovendor x boost_1_81_0.7z && ren vendor\boost_1_81_0 boost
# This is the earliest point at which we can do linting: clippy will end up
# building dynarmic, which needs Boost, but we don't need LLVM until
# building tests.
- name: Lint
shell: bash # no command output without this
run: dev-scripts/lint.sh
- name: Try to get cached copy of LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: tests/llvm
key: llvm_12_0_1_Windows_x64
- if: ${{ steps.cache-llvm.outputs.cache-hit != 'true' }}
name: Download LLVM
run: curl -L -O "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/LLVM-12.0.1-win64.exe"
- if: ${{ steps.cache-llvm.outputs.cache-hit != 'true' }}
name: Extract LLVM
run: 7z -otests/llvm x LLVM-12.0.1-win64.exe
- name: Test
run: cargo test
- name: Build
run: cargo build --release && move target/release/touchHLE.exe .
- uses: actions/upload-artifact@v3
with:
name: touchHLE_Windows_x86_64
path: touchHLE.exe
- uses: actions/upload-artifact@v3
with:
name: TestApp_built_on_Windows
path: tests/TestApp.app