forked from keiyoushi/extensions-source
-
Notifications
You must be signed in to change notification settings - Fork 3
103 lines (89 loc) · 2.57 KB
/
Copy pathbuild_push.yml
File metadata and controls
103 lines (89 loc) · 2.57 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
name: CI
on:
workflow_dispatch:
inputs:
release:
description: "Publish a release"
required: false
default: true
type: boolean
env:
CI_CHUNK_SIZE: 65
jobs:
build_individual:
name: Build individual modules
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v7
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5
- name: Prepare signing key
run: |
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
- name: Build extensions
env:
CI_CHUNK_NUM: 0
ALIAS: ${{ secrets.ALIAS }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
chmod +x ./gradlew | true
./gradlew -p src assembleRelease
- name: Upload APKs
uses: actions/upload-artifact@v7
with:
name: "individual-apks"
path: |
**/build/outputs/apk/release/*.apk
**/build/outputs/jar/release/*.jar
**/build/keiyoushi-source-info.json
retention-days: 1
- name: Clean up CI files
if: always()
run: rm signingkey.jks
publish_repo:
name: Publish repo
if: ${{ inputs.release == true }}
needs:
- build_individual
runs-on: ubuntu-latest
steps:
- name: Download APK artifacts
uses: actions/download-artifact@v8
with:
path: ~/apk-artifacts
- name: Checkout main branch
uses: actions/checkout@v7
with:
ref: main
path: main
persist-credentials: false
- name: Checkout repo branch
uses: actions/checkout@v7
with:
ref: repo
path: repo
persist-credentials: true
- name: Publish and deploy repo
env:
DELETE: '["zh.copymangas"]'
run: |
cd repo
pip install protobuf
python ../main/.github/scripts/publish-repo.py "$DELETE"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git status
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Update extensions repo"
git push
else
echo "No changes to commit"
fi