feat: 发布 billing 0.1.0
This commit is contained in:
+2
-2
@@ -14,6 +14,6 @@ if [[ -n "$unformatted" ]]; then
|
||||
fi
|
||||
go list -mod=readonly ./... >/dev/null
|
||||
CGO_ENABLED=1 go test ./...
|
||||
CGO_ENABLED=1 go build -tags cshared -buildmode=c-shared -o bin/cpa-ext.so ./cmd/cpa-ext
|
||||
CGO_ENABLED=1 go build -tags cshared -buildmode=c-shared -o bin/billing.so ./cmd/billing
|
||||
|
||||
echo "Built: $root/bin/cpa-ext.so"
|
||||
echo "Built: $root/bin/billing.so"
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
version="${1:-0.1.0}"
|
||||
target="linux_amd64"
|
||||
name="billing_${version}_${target}"
|
||||
artifact="$root/bin/billing.so"
|
||||
|
||||
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
|
||||
echo "Invalid version: $version" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -f "$artifact" ]]; then
|
||||
echo "Missing $artifact; run scripts/build.sh first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
stage="$(mktemp -d)"
|
||||
trap 'rm -rf "$stage"' EXIT
|
||||
package_dir="$stage/$name"
|
||||
mkdir -p "$package_dir" "$root/dist"
|
||||
|
||||
install -m 0755 "$artifact" "$package_dir/billing.so"
|
||||
install -m 0644 "$root/README.md" "$package_dir/README.md"
|
||||
install -m 0644 "$root/config.example.yaml" "$package_dir/config.example.yaml"
|
||||
printf '%s\n' \
|
||||
"name=billing" \
|
||||
"version=$version" \
|
||||
"target=linux/amd64" \
|
||||
"native_abi=1" \
|
||||
"rpc_schema=3" \
|
||||
"cliproxyapi_revision=f43aad7637ad813745bf7d341acb5663617570c5" \
|
||||
>"$package_dir/VERSION.txt"
|
||||
|
||||
archive="$root/dist/$name.tar.gz"
|
||||
tar -czf "$archive" -C "$stage" "$name"
|
||||
sha256sum "$archive" >"$archive.sha256"
|
||||
|
||||
echo "Packaged: $archive"
|
||||
echo "Checksum: $archive.sha256"
|
||||
Reference in New Issue
Block a user