-
Notifications
You must be signed in to change notification settings - Fork 15
68 lines (66 loc) · 2.18 KB
/
build.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
name: Build Encore Zip
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/workflows/build.yml'
- 'src/**'
- 'module/**'
- 'webui/**'
- 'gamelist.txt'
- 'version'
jobs:
build:
name: Build Flashable Zip
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: NDK Setup
uses: nttld/setup-ndk@v1
with:
ndk-version: r27b
- name: Build encore-service JNI
working-directory: ./src
run: ndk-build
- name: Build WebUI
working-directory: ./src/webui
run: |
npm install
npm run tailwind
npm run build
cp ./dist/* ../../module/webroot
- name: Compile flashable zip
id: compileZip
run: |
cp -r ./src/libs ./module
cp -r ./src/scripts/* ./module/system/bin
cp LICENSE ./module
bash ./gamelist_compile.sh
version="$(cat ./version)"
version_code=$(git rev-list HEAD --count)
gitsha1=$(git rev-parse --short HEAD)
sed -i "s/version=.*/version=$version (GIT@$gitsha1)/" ./module/module.prop
sed -i "s/versionCode=.*/versionCode=$version_code/" ./module/module.prop
zipName="encore-$version-$version_code_$gitsha1.zip" && echo "zipName=$zipName" >> $GITHUB_OUTPUT
cd ./module && zip -r9 ../$zipName * -x *placeholder *.map
- name: Upload to telegram
env:
CHAT_ID: ${{ secrets.CHAT_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_URL: ${{ github.event.head_commit.url }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
TITLE: Encore Tweaks
run: |
if [ ! -z "${{ secrets.CHAT_ID }}" ] && [ ! -z "${{ secrets.BOT_TOKEN }}" ]; then
export VERSION=$(git rev-list --count HEAD)
bash $GITHUB_WORKSPACE/.github/scripts/telegram_bot.sh $GITHUB_WORKSPACE/${{ steps.compileZip.outputs.zipName }}
else
echo "Telegram bot token is undefined, please add it to repository secrets!"
exit 1
fi