78 lines
2 KiB
YAML
78 lines
2 KiB
YAML
name: build module
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: env
|
|
run: |
|
|
GIT_COUNT=$(git rev-list --count HEAD 2>/dev/null)
|
|
GIT_TAG=$(git describe --tags 2>/dev/null || echo "v0.0.0ci")
|
|
echo "GCOUNT=$GIT_COUNT" >> $GITHUB_ENV
|
|
echo "GTAG=$GIT_TAG" >> $GITHUB_ENV
|
|
sed -i "s|^version=.*|version=$GIT_TAG|" "template/module.prop"
|
|
sed -i "s|^versionCode=.*|versionCode=$GIT_COUNT|" "template/module.prop"
|
|
sed -i "s|^updateJson=.*||" "template/module.prop"
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: grab zig
|
|
run: |
|
|
curl -L https://ziglang.org/download/0.15.2/zig-x86-linux-0.15.2.tar.xz -o zig.tar.xz
|
|
tar -xf zig.tar.xz
|
|
mv zig-* zig
|
|
|
|
- name: grab sstrip from ELFkickers
|
|
run: |
|
|
curl -L https://www.muppetlabs.com/~breadbox/pub/software/ELFkickers-3.2.tar.gz -o sstrip.tar.gz
|
|
tar xf sstrip.tar.gz
|
|
make -C ELFkickers-3.2 sstrip
|
|
cp ELFkickers-3.2/sstrip/sstrip .
|
|
|
|
- name: webui
|
|
run: |
|
|
cd webui
|
|
pnpm i
|
|
pnpm build
|
|
|
|
- name: compile binary via zigcc
|
|
run: |
|
|
echo "arm, aarch64 and x86_64"
|
|
pwd
|
|
chmod +x sstrip ; mv sstrip strip
|
|
|
|
PATH=$(pwd)/zig:$(pwd):$PATH
|
|
|
|
cd src; make
|
|
|
|
wc -c bin/mm_*
|
|
upx --ultra-brute bin/mm_*
|
|
|
|
wc -c bin/mm_*
|
|
file bin/mm_*
|
|
|
|
cd ../template
|
|
pwd
|
|
mkdir bin
|
|
pwd
|
|
mv -f ../src/bin/* bin/
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: meta-mm-ci-${{ env.GTAG }}-${{ env.GCOUNT }}
|
|
path: template
|