forked from LawnchairLauncher/lawnchair
-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (114 loc) · 3.61 KB
/
ci.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
name: CI
on:
push:
branches:
- '*-dev'
paths-ignore:
- '.idea/**'
- '.gitattributes'
- '.github/**.json'
- '.gitignore'
- '.gitmodules'
- '**.md'
- 'LICENSE'
- 'NOTICE'
pull_request:
paths-ignore:
- '.idea/**'
- '.gitattributes'
- '.github/**.json'
- '.gitignore'
- '.gitmodules'
- '**.md'
- 'LICENSE'
- 'NOTICE'
workflow_dispatch:
workflow_call:
jobs:
build-debug-apk:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Write sign info
if: github.repository_owner == 'LawnchairLauncher'
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo storePassword='${{ secrets.KEYSTORE_PASSWORD }}' >> keystore.properties
echo keyAlias='${{ secrets.KEY_ALIAS }}' >> keystore.properties
echo keyPassword='${{ secrets.KEY_PASSWORD }}' >> keystore.properties
echo storeFile='${{ github.workspace }}/key.jks' >> keystore.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Build debug APK
run: ./gradlew assembleLawnWithQuickstepDebug
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Debug APK
path: build/outputs/apk/lawnWithQuickstep/debug/*.apk
check-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- run: ./gradlew spotlessCheck
send-notifications:
runs-on: ubuntu-latest
if: github.repository_owner == 'LawnchairLauncher'
needs: build-debug-apk
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install gitpython requests
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Debug APK
path: artifacts/debug-apk
- name: Send notifications
run: python ci.py
env:
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }}
TELEGRAM_CI_CHANNEL_ID: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }}
TELEGRAM_TEAM_GROUP_ID: ${{ secrets.NOTIFY_CHANNEL_ID }}
ARTIFACT_DIRECTORY: artifacts/debug-apk
GITHUB_REF: ${{ github.ref }}
ACTION: internal_notifications
crowdin-auto-merge:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'lawnchair-bot' && github.event.pull_request.title == 'New Crowdin translations by Github Action'
needs: build-debug-apk
steps:
- env:
GH_TOKEN: ${{ secrets.LAWNCHAIR_BOT_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
gh pr comment $PR_URL --body "No issues found, auto-merging the Crowdin pull request."
gh pr merge $PR_URL --auto --squash --delete-branch