-
Notifications
You must be signed in to change notification settings - Fork 10
158 lines (155 loc) · 5.55 KB
/
snapshot.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
name: Publish snapshot
on:
push:
branches:
- 'master'
- 'snapshot/*'
paths-ignore:
- '**.md'
- '**.adoc'
- '**/.gitignore'
- '.github/**'
- '!.github/workflows/snapshot.yml'
jobs:
upload:
name: Upload
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- name: Check out
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Enable KVM
if: matrix.os == 'ubuntu-latest'
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Cached Konan
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-konan-
- name: Cached Gradle
uses: actions/cache@v4
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Android environment
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
echo "ANDROID_NDK_VERSION=27.2.12479018" >> $GITHUB_ENV
- name: Cached Android NDK
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@v4
with:
path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }}
key: ${{ runner.os }}-android-ndk-${{ env.ANDROID_NDK_VERSION }}
- name: Set up shell
if: matrix.os == 'windows-latest'
run: |
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
rm.exe "C:/WINDOWS/system32/bash.EXE"
- name: Install Automake
if: matrix.os == 'macOS-latest'
run: brew install automake libtool
- name: Install Automake (windows)
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
path-type: minimal
update: true
install: >-
base-devel
autotools
mingw-w64-x86_64-gcc
- name: Setup Android
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION"
- name: Skip Android (windows)
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: |
echo "skip.android=true" > local.properties
- name: Skip Android (macos)
if: matrix.os == 'macOS-latest'
run: |
echo "skip.android=true" > local.properties
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
- name: Check JVM
if: matrix.os != 'windows-latest'
run: ./gradlew jvmTest
- name: Check JVM (Windows)
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: ./gradlew jvmTest
- name: Check Linux
if: matrix.os == 'ubuntu-latest'
shell: bash
run: ./gradlew linuxX64Test
- name: Check iOS
if: matrix.os == 'macOS-latest'
shell: bash
run: ./gradlew iosX64Test
- name: Check Android
if: matrix.os == 'ubuntu-latest'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 27
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
ndk: ${{ env.ANDROID_NDK_VERSION }}
cmake: 3.22.1
script: ./gradlew connectedCheck
- name: Publish Linux
if: matrix.os == 'ubuntu-latest'
shell: bash
run: ./gradlew publishAndroidPublicationToMavenLocal publishLinuxX64PublicationToMavenLocal :jni:jvm:linux:publishJvmPublicationToMavenLocal -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }}
- name: Publish Windows
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: ./gradlew :jni:jvm:mingw:publishToMavenLocal -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }}
- name: Publish MacOS
if: matrix.os == 'macOS-latest'
shell: bash
run: ./gradlew publishToMavenLocal -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }}
- name: Copy artifact files
run: |
mkdir -p maven-local/snapshot
cp -r ~/.m2/repository/* maven-local/snapshot
- name: Upload linux artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: snapshot-linux
path: |
maven-local
!maven-local/**/maven-metadata-local.xml
- name: Upload macos artifacts
if: matrix.os == 'macOS-latest'
uses: actions/upload-artifact@v4
with:
name: snapshot-macos
path: |
maven-local
!maven-local/**/maven-metadata-local.xml
- name: Upload windows artifacts
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: snapshot-windows
path: |
maven-local
!maven-local/**/maven-metadata-local.xml