feat: v0.12.2 —— GitHub Actions 打 deb / rpm(x86_64 + aarch64)
- 新增 .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
This commit is contained in:
Executable
+61
@@ -0,0 +1,61 @@
|
||||
#!/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"
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env bash
|
||||
# 把 `make install` 装出来的目录打成 .rpm(用 rpmbuild,不需要 root)
|
||||
# 用法: build-rpm.sh <安装树> <版本> <x86_64|aarch64> <输出目录>
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
echo "用法: $0 <安装树> <版本> <x86_64|aarch64> <输出目录>" >&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
|
||||
|
||||
top=$work/rpmbuild
|
||||
mkdir -p "$top/BUILD" "$top/BUILDROOT" "$top/RPMS" "$top/SOURCES" "$top/SPECS" "$top/SRPMS"
|
||||
cp -a "$stage" "$top/SOURCES/root"
|
||||
find "$top/SOURCES/root" -type d -exec chmod 755 {} +
|
||||
install -Dm644 "$repo/README.md" "$top/SOURCES/root/usr/share/doc/voiletmark/README.md"
|
||||
|
||||
cat > "$top/SPECS/voiletmark.spec" <<EOF
|
||||
Name: voiletmark
|
||||
Version: $version
|
||||
Release: 1
|
||||
Summary: Lightweight cross-platform Markdown editor
|
||||
License: Proprietary
|
||||
URL: https://git.linuxacme.com/liyepan/VoiletMark
|
||||
BuildArch: $arch
|
||||
AutoReqProv: yes
|
||||
|
||||
%description
|
||||
VoiletMark is a Markdown editor built with Qt 5 and C++17. It renders
|
||||
Markdown in place, exports PDF, highlights code in 11 languages, edits
|
||||
tables directly, shows a folder sidebar with document outline and can
|
||||
run Git commands against the opened repository.
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}
|
||||
cp -a %{_sourcedir}/root/. %{buildroot}/
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/VoiletMark
|
||||
%{_datadir}/applications/voiletmark.desktop
|
||||
%{_datadir}/icons/hicolor/256x256/apps/voiletmark.png
|
||||
%{_docdir}/voiletmark/README.md
|
||||
EOF
|
||||
|
||||
rpmbuild --define "_topdir $top" -bb "$top/SPECS/voiletmark.spec" >/dev/null
|
||||
cp "$top/RPMS/$arch"/*.rpm "$out/"
|
||||
echo "已生成 $(ls "$out"/*.rpm)"
|
||||
Reference in New Issue
Block a user