-
Notifications
You must be signed in to change notification settings - Fork 43
99 lines (95 loc) · 2.91 KB
/
android-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
name: Android-Release
on:
schedule:
# scheduled to run UTC 22:00 (07:00 in South Korea), Every 1st of the month
- cron: '0 22 1 * *'
workflow_dispatch:
jobs:
build-android-on-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
working-directory: ./build/android
run: |
./gradlew bundleHostJar
./gradlew javadocJar
./gradlew sourcesJar
./gradlew :escargot:testDebugUnitTest
mv ./escargot/build/libs/escargot.jar ./escargot/build/libs/escargot-ubuntu.jar
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact-ubuntu
path: |
./build/android/escargot/build/**/escargot-*.aar
./build/android/escargot/build/**/escargot-*.jar
!./build/android/escargot/build/**/escargot-*Shell.aar
if-no-files-found: error
overwrite: true
build-android-on-macos:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: "zulu"
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
working-directory: ./build/android
run: |
./gradlew bundleHostJar
./gradlew :escargot:testDebugUnitTest
mv ./escargot/build/libs/escargot.jar ./escargot/build/libs/escargot-mac.jar
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact-mac
path: |
./build/android/escargot/build/libs/escargot-mac.jar
if-no-files-found: error
overwrite: true
merge-upload-release:
needs: [build-android-on-ubuntu, build-android-on-macos]
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: build-artifact-*
merge-multiple: true
- name: Set release date
run: |
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> $GITHUB_ENV
- name: Merge build artifacts
working-directory: ./artifacts
run: |
ls -R ./
echo ${RELEASE_DATE}
find . -type f -name "escargot-*.aar" -exec mv {} . \;
find . -type f -name "escargot-*.jar" -exec mv {} . \;
ls -R ./
- name: Upload final artifacts
uses: actions/upload-artifact@v4
with:
name: Android-Release-${{ env.RELEASE_DATE }}
path: |
./artifacts/escargot-*.aar
./artifacts/escargot-*.jar
if-no-files-found: error
overwrite: true