ci/cd
This commit is contained in:
parent
f749c00096
commit
02a9559956
2 changed files with 369 additions and 326 deletions
68
.github/workflows/compile.yml
vendored
68
.github/workflows/compile.yml
vendored
|
|
@ -1,7 +1,11 @@
|
|||
name: build module
|
||||
|
||||
name: build meta-mm
|
||||
on:
|
||||
push:
|
||||
branches: [ "dev" ]
|
||||
pull_request:
|
||||
branches: [ "dev" ]
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -12,16 +16,6 @@ jobs:
|
|||
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:
|
||||
|
|
@ -30,49 +24,35 @@ jobs:
|
|||
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: Setup zig
|
||||
uses: mlugg/setup-zig@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- 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 .
|
||||
cp ELFkickers-3.2/sstrip/sstrip ./strip
|
||||
chmod +x strip
|
||||
sudo mv strip /usr/bin/strip
|
||||
|
||||
- name: webui
|
||||
- name: Build
|
||||
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/
|
||||
cd ..
|
||||
bash build.sh --release
|
||||
cd build
|
||||
artifact_name=$(basename meta-*.zip .zip)
|
||||
echo "ARTIFACT_NAME=$artifact_name" >> $GITHUB_ENV
|
||||
unzip "$artifact_name".zip
|
||||
rm "$artifact_name".zip *.json
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: meta-mm-ci-${{ env.GTAG }}-${{ env.GCOUNT }}
|
||||
path: template
|
||||
name: ci-${{ env.ARTIFACT_NAME }}
|
||||
path: build
|
||||
|
|
|
|||
69
.github/workflows/release.yml
vendored
Normal file
69
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Setup zig
|
||||
uses: mlugg/setup-zig@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- 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 ./strip
|
||||
chmod +x strip
|
||||
sudo mv strip /usr/bin/strip
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd webui
|
||||
pnpm i
|
||||
pnpm build
|
||||
cd ..
|
||||
bash build.sh --release
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
draft: true
|
||||
files: |
|
||||
build/*.zip
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Switch to public branch and push
|
||||
run: |
|
||||
git fetch origin
|
||||
git switch public
|
||||
cp build/*.json ./
|
||||
git add *.json
|
||||
git commit -m "[skip ci] Update build json files"
|
||||
git push origin public
|
||||
Loading…
Reference in a new issue