Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: switch to arm64 native build #366

Merged
merged 2 commits into from
Feb 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 3 additions & 72 deletions .github/workflows/build-terre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
path: release/WebGAL_Terre_Linux.zip
build-arm64:
name: Build Linux ARM64 Binary
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -45,79 +45,10 @@ jobs:
with:
node-version-file: package.json
cache: 'yarn'
- name: Build Stage 1
run: |
echo "Welcome to build WebGAL Terre, the editor of WebGAL platform."
# 安装依赖
yarn install --frozen-lockfile
# 清理
test -d release && rm -rf release
mkdir release
# 进入 Terre 目录
cd packages/terre2
yarn run build
- name: Build pkg ARM64
uses: pguyot/arm-runner-action@v2
with:
base_image: raspios_lite_arm64:latest
bind_mount_repository: true
commands: |
apt-get update
apt-get install -y curl sudo
# Install Node.js v18.x
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
apt-get install -y nodejs
# Enable yarn
corepack prepare [email protected] --activate
corepack enable yarn
cd packages/terre2
yarn run pkg:linux-arm64
- name: Build Stage 2
- name: Build
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
sudo chmod 777 -R .
cd packages/terre2/dist
cp -r WebGAL_Terre ../../../release
rm WebGAL_Terre
cd ../
mkdir Exported_Games
cp -r public assets Exported_Games ../../release
cd ../../
# 进入 Origine 目录
cd packages/origine2
# 低内存,使用下一行限制内存使用
# export NODE_OPTIONS=--max_old_space_size=512000
yarn run build
cp -rf dist/* ../../release/public/
cd ../../
# 进入 Electron 目录
cd packages/WebGAL-electron
yarn install --frozen-lockfile
yarn run build:arm64
mkdir ../../release/assets/templates/WebGAL_Electron_Template
cp -rf build/linux-arm64-unpacked/* ../../release/assets/templates/WebGAL_Electron_Template/
cd ../../
# 克隆 WebGAL Android 模板
cd release/assets/templates/
git clone https://github.com/nini22P/WebGAL-Android.git
mv WebGAL-Android WebGAL_Android_Template
# MainActivity.kt 移动到主文件夹防止误删
mv WebGAL_Android_Template/app/src/main/java/com/openwebgal/demo/MainActivity.kt WebGAL_Android_Template/app/src/main/java/MainActivity.kt
cd ../../../
cd release
# 删除冗余文件
rm -rf Exported_Games/*
rm -rf public/games/*
rm -rf public/games/.gitkeep
rm -rf assets/templates/WebGAL_Template/game/video/*
rm -rf assets/templates/WebGAL_Template/game/video/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/.github
rm -rf assets/templates/WebGAL_Android_Template/.git
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com
echo "WebGAL Terre is now ready to be deployed."
run: sh release-linux-arm64.sh
- name: Compress
run: 7z a -tzip release/WebGAL_Terre_Linux_Arm64.zip release/*

Expand Down