build: add portable plugin archives

This commit is contained in:
mirivlad 2026-07-13 22:29:46 +08:00
parent 22c842d5e3
commit 47c1db9979
3 changed files with 67 additions and 16 deletions

View File

@ -28,19 +28,21 @@ cd ../verstak-desktop
./scripts/install-dev-plugins.sh ./scripts/install-dev-plugins.sh
``` ```
## Windows test packages from Linux ## Portable plugin archives
Install a MinGW cross-compiler, then build a separate Windows amd64 package Build target-specific archives on Linux:
tree:
```bash ```bash
sudo apt install gcc-mingw-w64-x86-64 sudo apt install gcc-mingw-w64-x86-64
./scripts/build-windows.sh ./scripts/package-portable.sh v0.1.0-alpha.1
``` ```
The result is `dist-windows/`. Go sidecars, when a plugin has one, are emitted The command creates `release/verstak-official-plugins-linux-amd64-<version>.tar.gz`
as `backend/<plugin-id>.exe`; frontends and manifests are the same packaged and `release/verstak-official-plugins-windows-amd64-<version>.zip`, plus
files used on Linux. This is a local test output and is not a GitHub Release. `SHA256SUMS`. Each archive expands directly into the desktop application's
`plugins/` directory. Frontends and manifests are shared; native Go sidecars
are built for the target OS. This is a local package operation and does not
create a GitHub Release.
## Alpha behaviour ## Alpha behaviour
@ -52,15 +54,6 @@ files used on Linux. This is a local test output and is not a GitHub Release.
explicit unassigned scope. Journal creation is always a user action. explicit unassigned scope. Journal creation is always a user action.
- Todo is optional: Overview uses it only when the Todo capability is present. - Todo is optional: Overview uses it only when the Todo capability is present.
## Release package
```bash
./scripts/release.sh v0.1.0-alpha.1
```
The command rebuilds all packages and writes
`release/verstak-official-plugins-<version>.tar.gz` plus `SHA256SUMS`.
## Publish a GitHub Release ## Publish a GitHub Release
```bash ```bash

37
scripts/package-portable.sh Executable file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
VERSION="${1:-}"
if [[ -z "$VERSION" || ! "$VERSION" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then
echo "usage: $0 <version>" >&2
echo "example: $0 v0.1.0-alpha.1" >&2
exit 2
fi
if ! command -v zip >/dev/null; then
echo "zip is required to create the Windows plugin archive" >&2
exit 1
fi
echo "=== verstak official portable plugin packages $VERSION ==="
"$ROOT/scripts/build.sh"
"$ROOT/scripts/build-windows.sh"
RELEASE_ROOT="$ROOT/release"
LINUX_ARCHIVE="$RELEASE_ROOT/verstak-official-plugins-linux-amd64-$VERSION.tar.gz"
WINDOWS_ARCHIVE="$RELEASE_ROOT/verstak-official-plugins-windows-amd64-$VERSION.zip"
rm -rf "$RELEASE_ROOT"
mkdir -p "$RELEASE_ROOT"
# Each archive expands directly into the desktop application's plugins/
# directory. Frontends and manifests are shared; platform-test's native
# sidecar is built for the target operating system.
tar -C "$ROOT/dist" -czf "$LINUX_ARCHIVE" .
(cd "$ROOT/dist-windows" && zip -qr "$WINDOWS_ARCHIVE" .)
(cd "$RELEASE_ROOT" && sha256sum "$(basename "$LINUX_ARCHIVE")" "$(basename "$WINDOWS_ARCHIVE")" > SHA256SUMS)
echo "Linux plugins: $LINUX_ARCHIVE"
echo "Windows plugins: $WINDOWS_ARCHIVE"
echo "checksums: $RELEASE_ROOT/SHA256SUMS"

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
PACKAGER="$ROOT/scripts/package-portable.sh"
if [[ ! -x "$PACKAGER" ]]; then
echo "portable plugin packager is missing or not executable: $PACKAGER" >&2
exit 1
fi
bash -n "$PACKAGER"
grep -Fq 'scripts/build.sh' "$PACKAGER"
grep -Fq 'scripts/build-windows.sh' "$PACKAGER"
grep -Fq 'verstak-official-plugins-linux-amd64-' "$PACKAGER"
grep -Fq 'verstak-official-plugins-windows-amd64-' "$PACKAGER"
grep -Fq 'tar -C' "$PACKAGER"
grep -Fq 'zip -qr' "$PACKAGER"
grep -Fq 'SHA256SUMS' "$PACKAGER"
echo "portable plugin package script contract passed"