Build cli v0.15.2 (#684)

This commit is contained in:
Sung 2025-10-05 21:26:12 -07:00 committed by GitHub
commit a62c7f9e93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 108 additions and 25 deletions

View file

@ -36,7 +36,7 @@ if [[ $1 == v* ]]; then
exit 1
fi
goVersion=go-1.21.x
goVersion=go-1.25.x
get_binary_name() {
platform=$1
@ -57,7 +57,7 @@ build() {
# build binary
destDir="$outputDir/$platform-$arch"
ldflags="-X main.apiEndpoint=https://api.getdnote.com -X main.versionTag=$version"
ldflags="-X main.apiEndpoint=https://localhost:3000/api -X main.versionTag=$version"
tags="fts5"
pushd "$projectDir"
@ -92,7 +92,7 @@ build() {
popd
binaryName=$(get_binary_name "$platform")
mv "$destDir/cli-${platform}-"* "$destDir/$binaryName"
mv "$destDir/cli-"* "$destDir/$binaryName"
# build tarball
tarballName="dnote_${version}_${platform}_${arch}.tar.gz"
@ -113,10 +113,20 @@ if [ -z "$GOOS" ] && [ -z "$GOARCH" ]; then
# install the tool
go install src.techknowlogick.com/xgo@latest
# Linux
build linux amd64
build linux arm64
build linux arm
# macOS
build darwin amd64
build darwin arm64
# Windows
build windows amd64
# FreeBSD
build freebsd amd64
else
build "$GOOS" "$GOARCH" true
fi

View file

@ -10,12 +10,13 @@ if [ ! -d "$cliHomebrewDir" ]; then
fi
version=$1
tarball=$2
echo "version: $version"
echo "tarball: $tarball"
sha=$(shasum -a 256 "$tarball" | cut -d ' ' -f 1)
# Download source tarball and calculate SHA256
source_url="https://github.com/dnote/dnote/archive/refs/tags/cli-v${version}.tar.gz"
echo "Calculating SHA256 for: $source_url"
sha=$(curl -L "$source_url" | shasum -a 256 | cut -d ' ' -f 1)
pushd "$cliHomebrewDir"
@ -25,14 +26,18 @@ git pull origin master
cat > ./Formula/dnote.rb << EOF
class Dnote < Formula
desc "A simple command line notebook for programmers"
desc "Simple command line notebook for programmers"
homepage "https://www.getdnote.com"
url "https://github.com/dnote/dnote/releases/download/cli-v${version}/dnote_${version}_darwin_amd64.tar.gz"
version "${version}"
url "https://github.com/dnote/dnote/archive/refs/tags/cli-v${version}.tar.gz"
sha256 "${sha}"
license "GPL-3.0"
head "https://github.com/dnote/dnote.git", branch: "master"
depends_on "go" => :build
def install
bin.install "dnote"
ldflags = "-s -w -X main.apiEndpoint=https://api.getdnote.com -X main.versionTag=#{version}"
system "go", "build", *std_go_args(ldflags: ldflags), "-tags", "fts5", "./pkg/cli"
end
test do