Skip to content

v1.1.14.3

v1.1.14.3 #29

Workflow file for this run

name: Release — Build & Publish
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*.*'
workflow_dispatch:
inputs:
version:
description: "版本号(如 v1.2.0)"
required: true
type: string
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
# ── 确定版本号 ──────────────────────────────────────────────────────────────
prepare:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- id: version
name: Resolve version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${GITHUB_REF_NAME}"
fi
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Version: ${VERSION}"
# ── 验证基础文件 ────────────────────────────────────────────────────────────
validate:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v4
- name: Create test .env
run: |
cat > .env << 'EOF'
DATA_DIR=./data
TZ=Asia/Shanghai
EOF
- name: Validate docker-compose syntax
run: docker compose config --quiet
- name: Validate nginx config syntax
run: |
if [ -f niginx.conf ]; then
docker run --rm \
--add-host backend:127.0.0.1 \
--add-host thingsvis-server:127.0.0.1 \
--add-host thingsvis-studio:127.0.0.1 \
-v "$PWD/niginx.conf:/etc/nginx/nginx.conf:ro" \
nginx:alpine nginx -t
fi
- name: Check script syntax (bash)
run: |
bash -n install.bash
bash -n install.sh
bash -n upgrade.sh
bash -n uninstall.sh
build-windows:
runs-on: windows-latest
needs: [prepare, validate]
steps:
- uses: actions/checkout@v4
- name: Install Inno Setup
run: choco install innosetup --no-progress -y
- name: Create placeholder icon (if not exists)
shell: pwsh
run: |
$iconDir = "packaging\windows\assets"
New-Item -ItemType Directory -Path $iconDir -Force | Out-Null
if (-not (Test-Path "$iconDir\thingspanel.ico")) {
Copy-Item "$env:SystemRoot\System32\shell32.dll" "$iconDir\thingspanel.ico" -ErrorAction SilentlyContinue || $true
}
if (-not (Test-Path "$iconDir\sidebar.bmp")) {
[System.IO.File]::WriteAllBytes("$iconDir\sidebar.bmp", [byte[]]@(66,77,58,0,0,0,0,0,0,0,54,0,0,0,40,0,0,0,1,0,0,0,1,0,0,0,1,0,24,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0))
}
- name: Build Windows installer
shell: cmd
env:
TP_VERSION: ${{ needs.prepare.outputs.version }}
run: |
if not exist dist\windows mkdir dist\windows
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DTP_VERSION=%TP_VERSION% packaging\windows\ThingsPanel-Setup.iss
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: dist/windows/ThingsPanel-Setup-*.exe
retention-days: 7
build-macos:
runs-on: macos-latest
needs: [prepare, validate]
steps:
- uses: actions/checkout@v4
- name: Make scripts executable
run: |
chmod +x packaging/macos/build.sh
chmod +x packaging/macos/scripts/preinstall
chmod +x packaging/macos/scripts/postinstall
- name: Build macOS installer
env:
TP_VERSION: ${{ needs.prepare.outputs.version }}
run: ./packaging/macos/build.sh
- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: macos-installer
path: dist/macos/ThingsPanel-*.pkg
retention-days: 7
release:
runs-on: ubuntu-latest
needs: [prepare, build-windows, build-macos]
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download Windows installer
uses: actions/download-artifact@v4
with:
name: windows-installer
path: dist/windows
- name: Download macOS installer
uses: actions/download-artifact@v4
with:
name: macos-installer
path: dist/macos
- name: Generate SHA256 checksums
run: |
cd dist
touch SHA256SUMS.txt
find . -type f \( -name "*.exe" -o -name "*.pkg" \) | sort | while read f; do
sha256sum "$f" >> SHA256SUMS.txt
done
sha256sum ../install.sh >> SHA256SUMS.txt
cat SHA256SUMS.txt
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare.outputs.version }}
name: "ThingsPanel All-in-One ${{ needs.prepare.outputs.version }}"
body: |
## ThingsPanel All-in-One ${{ needs.prepare.outputs.version }}
### 快速安装
**Linux / macOS(推荐)**
```bash
curl -fsSL https://install.thingspanel.io/install.sh | sh
```
**Windows**
下载下方 `ThingsPanel-Setup-*.exe`,右键"以管理员身份运行"。
**macOS(图形界面)**
下载下方 `ThingsPanel-*.pkg`,双击安装。
### 前置要求
- Docker Desktop(Windows / macOS)或 Docker Engine(Linux)
- 内存 ≥ 2GB
draft: false
prerelease: ${{ contains(needs.prepare.outputs.version, 'rc') || contains(needs.prepare.outputs.version, 'beta') }}
files: |
dist/windows/*.exe
dist/macos/*.pkg
dist/SHA256SUMS.txt
install.sh
upgrade.sh
uninstall.sh