Introduce Encore WebUI #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Encore JNI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/build.yml' | |
- 'src/**' | |
- 'module/**' | |
- 'gamelist.txt' | |
jobs: | |
build: | |
name: Build JNI | |
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: r27 | |
- name: Build encore-service JNI | |
working-directory: ./src | |
run: ndk-build | |
- name: Copy binaries | |
run: | | |
cp ./src/libs/armeabi-v7a/encore-service ./module/libs/armeabi-v7a | |
cp ./src/libs/arm64-v8a/encore-service ./module/libs/arm64-v8a | |
cp LICENSE ./module | |
- name: Compile Gamelist | |
run: | | |
bash ./gamelist_compile.sh | |
- name: Build WebUI | |
working-directory: ./webui | |
run: | | |
npm install | |
npm run tailwind | |
npm run build | |
cp ./dist/* ../module/webui | |
- name: Copy out version | |
id: copyOutVersion | |
run: | | |
version="v1.2" | |
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 build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.copyOutVersion.outputs.zipName }} | |
path: ./ | |
- 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.BOT_TOKEN }}" ]; then | |
export VERSION=$(git rev-list --count HEAD) | |
bash $GITHUB_WORKSPACE/.github/scripts/telegram_bot.sh $GITHUB_WORKSPACE/${{ steps.copyOutVersion.outputs.zipName }} | |
fi |