Prepare v0.0.2 pre-release
This commit is contained in:
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 --linux PATH --macos PATH --windows PATH" >&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
linux_binary=
|
||||
macos_binary=
|
||||
windows_binary=
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
--linux) linux_binary=${2:-}; shift 2 ;;
|
||||
--macos) macos_binary=${2:-}; shift 2 ;;
|
||||
--windows) windows_binary=${2:-}; shift 2 ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -n "$linux_binary" && -f "$linux_binary" ]] || usage
|
||||
[[ -n "$macos_binary" && -f "$macos_binary" ]] || usage
|
||||
[[ -n "$windows_binary" && -f "$windows_binary" ]] || usage
|
||||
|
||||
version=$(sed -n 's/^version = "\\([^"]*\\)"/\\1/p' Cargo.toml | head -n 1)
|
||||
[[ -n "$version" ]] || { echo "Could not read the package version." >&2; exit 1; }
|
||||
|
||||
dist=dist
|
||||
stage=$(mktemp -d)
|
||||
repository_root=$PWD
|
||||
trap 'rm -rf "$stage"' EXIT
|
||||
rm -rf "$dist"
|
||||
mkdir -p "$dist"
|
||||
|
||||
package_tarball() {
|
||||
local platform=$1 binary=$2
|
||||
local root="mudmouth-v${version}-${platform}"
|
||||
mkdir -p "$stage/$root"
|
||||
cp "$binary" "$stage/$root/mudmouth"
|
||||
cp README.md LICENSE config.toml "$stage/$root/"
|
||||
tar -C "$stage" -czf "$dist/$root.tar.gz" "$root"
|
||||
rm -rf "$stage/$root"
|
||||
}
|
||||
|
||||
package_tarball x86_64-unknown-linux-gnu "$linux_binary"
|
||||
package_tarball x86_64-apple-darwin "$macos_binary"
|
||||
|
||||
windows_root="mudmouth-v${version}-x86_64-pc-windows-gnu"
|
||||
mkdir -p "$stage/$windows_root"
|
||||
cp "$windows_binary" "$stage/$windows_root/mudmouth.exe"
|
||||
cp README.md LICENSE config.toml "$stage/$windows_root/"
|
||||
(
|
||||
cd "$stage"
|
||||
zip -q -r "$repository_root/$dist/${windows_root}.zip" "$windows_root"
|
||||
)
|
||||
|
||||
(
|
||||
cd "$dist"
|
||||
sha256sum -- *.tar.gz *.zip > SHA256SUMS.txt
|
||||
)
|
||||
|
||||
printf 'Created release assets in %s:\n' "$dist"
|
||||
cat "$dist/SHA256SUMS.txt"
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
version=$(sed -n 's/^version = "\\([^"]*\\)"/\\1/p' Cargo.toml | head -n 1)
|
||||
tag="v${version}"
|
||||
dist=dist
|
||||
checksums="$dist/SHA256SUMS.txt"
|
||||
notes=$(mktemp)
|
||||
trap 'rm -f "$notes"' EXIT
|
||||
|
||||
[[ -f "$checksums" ]] || { echo "Missing $checksums; run scripts/package-release.sh first." >&2; exit 1; }
|
||||
|
||||
cat > "$notes" <<EOF
|
||||
## Pre-release
|
||||
|
||||
First multi-platform pre-release of Mudmouth. It includes first-run EverQuest
|
||||
log discovery, setup, and the refreshed development documentation.
|
||||
|
||||
## SHA-256
|
||||
|
||||
\`\`\`
|
||||
$(cat "$checksums")
|
||||
\`\`\`
|
||||
EOF
|
||||
|
||||
for asset in "$dist"/mudmouth-v"$version"-*.tar.gz "$dist"/mudmouth-v"$version"-*.zip "$checksums"; do
|
||||
"$HOME/.agents/skills/publish-gitea-release/scripts/gitea-publish-asset.sh" \
|
||||
--tag "$tag" \
|
||||
--asset "$asset" \
|
||||
--title "Mudmouth $tag (pre-release)" \
|
||||
--body-file "$notes"
|
||||
done
|
||||
Reference in New Issue
Block a user