meta-magic_mount/.github/workflows/compile.yml
2025-11-23 21:35:36 +08:00

75 lines
2.1 KiB
YAML

name: build meta-mm
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
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
cd build
artifact_name=$(basename meta-*release.zip .zip)
unzip "$artifact_name".zip
mv "$artifact_name".zip "${artifact_name/release/ci}".zip
echo "ARTIFACT_NAME=${artifact_name/release/ci}" >> $GITHUB_ENV
- name: Notify Telegram
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
TAG_NAME=${GITHUB_REF##*/}
CAPTION="*CI ${TAG_NAME}*"
RELEASE_FILE=$(find build -maxdepth 1 -type f -name "meta*ci.zip")
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \
-F chat_id="${TELEGRAM_CHAT_ID}" \
-F parse_mode="Markdown" \
-F caption="$CAPTION" \
-F document=@"${RELEASE_FILE}"
rm build/{*.zip,*.json,*.md}
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: ${{ env.ARTIFACT_NAME }}
path: build