This repository was archived by the owner on Jun 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (106 loc) · 3.65 KB
/
Copy pathmain.yaml
File metadata and controls
122 lines (106 loc) · 3.65 KB
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
name: Debug android 🎮
run-name: Debug android 🎮 ${{ github.ref }} ${{ github.sha }}
on:
workflow_dispatch:
permissions:
contents: write
env:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
jobs:
build:
name: Build for Android 🖥️
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- "LibraryOA"
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: true
# Checkout
- name: Checkout repository
uses: actions/checkout@v4
# Cache
- uses: actions/cache@v4
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Build
- uses: game-ci/unity-builder@v4
with:
versioning: Semantic
projectPath: ${{ matrix.projectPath }}
targetPlatform: Android
androidExportType: androidPackage
androidKeystoreName: user
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
androidTargetSdkVersion: AndroidApiLevel33
buildName: Libtake-development-${{ github.run_number }}
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: "Libtake-development-${{ github.run_number }}"
path: build
release:
name: Create GitHub Release 📦
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: "Libtake-development-${{ github.run_number }}"
path: extracted_build
- name: Extract APK
id: extract_apk
run: |
APK_FILE=$(find extracted_build -name "*.apk")
echo "APK_FILE=$APK_FILE" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
tag_name: "build-${{ github.run_number }}"
release_name: "Build ${{ github.run_number }}"
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload APK to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.APK_FILE }}
asset_name: "LibraryOA-android-${{ github.run_number }}.apk"
asset_content_type: application/vnd.android.package-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify:
name: Notify via Telegram 📲
runs-on: ubuntu-latest
needs: release
steps:
- name: Send Telegram Notification with Download Link
uses: appleboy/telegram-action@master
with:
token: ${{ secrets.TELEGRAM_TOKEN }}
to: ${{ secrets.TELEGRAM_CI_CHAT_ID }}
message: |
"New build for the LibraryOA project is ready!
Download the APK here: https://github.com/${{ github.repository }}/releases/download/build-${{ github.run_number }}/LibraryOA-android-${{ github.run_number }}.apk"