85 lines
2.3 KiB
YAML
85 lines
2.3 KiB
YAML
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:
|
|
body_path: build/changelog.md
|
|
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
|
|
cat build/version.json > version.json
|
|
cat build/changelog.md > changelog.md
|
|
git add version.json changelog.md
|
|
git commit -m "[skip ci] Update build files"
|
|
git push origin public
|
|
|
|
- name: Notify Telegram
|
|
env:
|
|
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
|
|
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
|
|
run: |
|
|
TAG_NAME=${GITHUB_REF##*/}
|
|
CAPTION="*[Release ${TAG_NAME}](https://magic-mount.zrlab.org/changelog)*"
|
|
RELEASE_FILE=$(find build -maxdepth 1 -type f -name "meta*release.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}"
|