- 新增 .github/workflows/linux-packages.yml(Gitea 不跑,给 GitHub 镜像用) 推送 / 打 tag / 手动触发 / PR 时编译,并用下面两个脚本打出安装包 - packaging/build-deb.sh:把 make install 的目录打成 .deb(含依赖、README) - packaging/build-rpm.sh:用 rpmbuild 打成 .rpm(文件布局、%defattr 都设好) - x86_64 用 ubuntu-22.04 runner,aarch64 用 ubuntu-24.04-arm(公共仓库才有, 私有仓库里 ARM 那一步失败不影响 x86_64 的包) - 构建产物上传 artifact;打 tag 时自动生成 SHA256SUMS 并挂到 Release - README 补「打包(Linux)」一节,.gitignore 忽略本地 dist/*.deb/*.rpm
62 lines
1.7 KiB
Bash
Executable File
62 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# 把 `make install` 装出来的目录打成 .deb
|
|
# 用法: build-deb.sh <安装树> <版本> <amd64|arm64> <输出目录>
|
|
set -euo pipefail
|
|
|
|
usage() {
|
|
echo "用法: $0 <安装树> <版本> <amd64|arm64> <输出目录>" >&2
|
|
exit 2
|
|
}
|
|
|
|
[ $# -eq 4 ] || usage
|
|
|
|
stage=$(cd "$1" && pwd)
|
|
version=$2
|
|
arch=$3
|
|
mkdir -p "$4"
|
|
out=$(cd "$4" && pwd)
|
|
|
|
if [ ! -x "$stage/usr/bin/VoiletMark" ]; then
|
|
echo "安装树里找不到 usr/bin/VoiletMark: $stage" >&2
|
|
exit 1
|
|
fi
|
|
|
|
repo=$(cd "$(dirname "$0")/.." && pwd)
|
|
|
|
work=$(mktemp -d)
|
|
trap 'rm -rf "$work"' EXIT
|
|
|
|
root=$work/root
|
|
mkdir -p "$root"
|
|
cp -a "$stage"/. "$root"/
|
|
chmod 755 "$root"
|
|
find "$root" -type d -exec chmod 755 {} +
|
|
install -Dm644 "$repo/README.md" "$root/usr/share/doc/voiletmark/README.md"
|
|
|
|
mkdir -p "$root/DEBIAN"
|
|
installed_size=$(du -sk "$root/usr" | cut -f1)
|
|
|
|
cat > "$root/DEBIAN/control" <<EOF
|
|
Package: voiletmark
|
|
Version: $version
|
|
Section: editors
|
|
Priority: optional
|
|
Architecture: $arch
|
|
Depends: libc6 (>= 2.28), libstdc++6, libqt5core5a (>= 5.12), libqt5gui5 (>= 5.12), libqt5widgets5 (>= 5.12), libgl1
|
|
Recommends: git
|
|
Installed-Size: $installed_size
|
|
Maintainer: liyepan <liyepan@linuxacme.com>
|
|
Homepage: https://git.linuxacme.com/liyepan/VoiletMark
|
|
Description: Lightweight cross-platform Markdown editor
|
|
VoiletMark is a Markdown editor built with Qt 5 and C++17.
|
|
.
|
|
Features: in-place Markdown rendering, source mode, syntax
|
|
highlighting for 11 languages, editable tables, PDF export,
|
|
folder sidebar with document outline, Git integration, Chinese
|
|
and English interface, light / dark themes.
|
|
EOF
|
|
|
|
name=$(printf 'voiletmark_%s_%s.deb' "$version" "$arch")
|
|
dpkg-deb --build --root-owner-group "$root" "$out/$name" >/dev/null
|
|
echo "已生成 $out/$name"
|