chore: bootstrap independent git workflow
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
13
scripts/git/gitea-askpass.sh
Executable file
13
scripts/git/gitea-askpass.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
*Username*)
|
||||
printf '%s\n' "${GITEA_USERNAME:?GITEA_USERNAME is required}"
|
||||
;;
|
||||
*Password*)
|
||||
printf '%s\n' "${GITEA_TOKEN:?GITEA_TOKEN is required}"
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
36
scripts/release/package-unix.sh
Executable file
36
scripts/release/package-unix.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "usage: scripts/release/package-unix.sh <target-triple> <binary-path>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
target_triple="$1"
|
||||
binary_path="$2"
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
version="$(node "$repo_root/scripts/release/version.mjs")"
|
||||
artifact_basename="dbtool-$version-$target_triple"
|
||||
artifact_dir="$repo_root/dist/$artifact_basename"
|
||||
archive_path="$repo_root/dist/$artifact_basename.tar.gz"
|
||||
checksum_path="$archive_path.sha256"
|
||||
|
||||
mkdir -p "$repo_root/dist"
|
||||
rm -rf "$artifact_dir"
|
||||
mkdir -p "$artifact_dir"
|
||||
|
||||
cp "$binary_path" "$artifact_dir/dbtool"
|
||||
cp "$repo_root/README.md" "$artifact_dir/README.md"
|
||||
cp "$repo_root/RELEASE_RUNBOOK.md" "$artifact_dir/RELEASE_RUNBOOK.md"
|
||||
cp "$repo_root/SMOKE_RUNBOOK.md" "$artifact_dir/SMOKE_RUNBOOK.md"
|
||||
|
||||
tar -czf "$archive_path" -C "$repo_root/dist" "$artifact_basename"
|
||||
|
||||
(
|
||||
cd "$repo_root/dist"
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
sha256sum "$(basename "$archive_path")" > "$(basename "$checksum_path")"
|
||||
else
|
||||
shasum -a 256 "$(basename "$archive_path")" > "$(basename "$checksum_path")"
|
||||
fi
|
||||
)
|
||||
12
scripts/release/smoke-binary.sh
Executable file
12
scripts/release/smoke-binary.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "usage: scripts/release/smoke-binary.sh <binary-path>" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
binary_path="$1"
|
||||
|
||||
"$binary_path" --help
|
||||
"$binary_path" --version
|
||||
11
scripts/release/version.mjs
Normal file
11
scripts/release/version.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
const cargoToml = readFileSync(new URL("../../Cargo.toml", import.meta.url), "utf8");
|
||||
const match = cargoToml.match(/\[workspace\.package\][\s\S]*?version\s*=\s*"([^"]+)"/);
|
||||
|
||||
if (!match) {
|
||||
console.error("failed to resolve workspace.package.version from Cargo.toml");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.stdout.write(match[1]);
|
||||
Reference in New Issue
Block a user