Merge branch 'silverbulletmd:main' into fix-table-indexer-empty-cells
This commit is contained in:
@@ -23,30 +23,7 @@ jobs:
|
||||
deno task build-production
|
||||
deno task build-plug-compile
|
||||
- name: Build Go binaries for multiple platforms
|
||||
run: |
|
||||
# Linux ARM64
|
||||
GOOS=linux GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-aarch64.zip silverbullet
|
||||
|
||||
# Linux x86_64
|
||||
GOOS=linux GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-x86_64.zip silverbullet
|
||||
|
||||
# macOS ARM64
|
||||
GOOS=darwin GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-aarch64.zip silverbullet
|
||||
|
||||
# macOS x86_64
|
||||
GOOS=darwin GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-x86_64.zip silverbullet
|
||||
|
||||
# Windows x86_64
|
||||
GOOS=windows GOARCH=amd64 go build -o silverbullet.exe .
|
||||
zip silverbullet-server-windows-x86_64.zip silverbullet.exe
|
||||
|
||||
# FreeBSD x86_64
|
||||
GOOS=freebsd GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-freebsd-x86_64.zip silverbullet
|
||||
run: make build-server-releases
|
||||
|
||||
- name: Update edge release
|
||||
uses: softprops/action-gh-release@v1
|
||||
|
||||
@@ -23,30 +23,7 @@ jobs:
|
||||
deno task build-production
|
||||
deno task build-plug-compile
|
||||
- name: Build Go binaries for multiple platforms
|
||||
run: |
|
||||
# Linux ARM64
|
||||
GOOS=linux GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-aarch64.zip silverbullet
|
||||
|
||||
# Linux x86_64
|
||||
GOOS=linux GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-linux-x86_64.zip silverbullet
|
||||
|
||||
# macOS ARM64
|
||||
GOOS=darwin GOARCH=arm64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-aarch64.zip silverbullet
|
||||
|
||||
# macOS x86_64
|
||||
GOOS=darwin GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-darwin-x86_64.zip silverbullet
|
||||
|
||||
# Windows x86_64
|
||||
GOOS=windows GOARCH=amd64 go build -o silverbullet.exe .
|
||||
zip silverbullet-server-windows-x86_64.zip silverbullet.exe
|
||||
|
||||
# FreeBSD x86_64
|
||||
GOOS=freebsd GOARCH=amd64 go build -o silverbullet .
|
||||
zip silverbullet-server-freebsd-x86_64.zip silverbullet
|
||||
run: make build-server-releases
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
|
||||
@@ -1,21 +1,31 @@
|
||||
LDFLAGS = -X main.buildTime=$$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
|
||||
build:
|
||||
# Build client
|
||||
deno task build
|
||||
# Build plug-compile
|
||||
deno task build-plug-compile
|
||||
# Build server
|
||||
go build
|
||||
go build -ldflags "$(LDFLAGS)"
|
||||
|
||||
build-for-docker: build
|
||||
GOOS=linux GOARCH=arm64 go build -o silverbullet-arm64 .
|
||||
GOOS=linux GOARCH=amd64 go build -o silverbullet-amd64 .
|
||||
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o silverbullet-arm64 .
|
||||
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet-amd64 .
|
||||
|
||||
docker: build-for-docker
|
||||
docker buildx build --platform linux/arm64,linux/amd64 --push .
|
||||
|
||||
build-server-releases:
|
||||
GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-linux-aarch64.zip silverbullet
|
||||
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-linux-x86_64.zip silverbullet
|
||||
GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-darwin-aarch64.zip silverbullet
|
||||
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-darwin-x86_64.zip silverbullet
|
||||
GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet.exe . && zip silverbullet-server-windows-x86_64.zip silverbullet.exe
|
||||
GOOS=freebsd GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-freebsd-x86_64.zip silverbullet
|
||||
|
||||
clean:
|
||||
rm -rf client_bundle/{base_fs,client} dist public_version.ts
|
||||
rm -f silverbullet silverbullet-arm64 silverbullet-amd64
|
||||
rm -f silverbullet silverbullet-arm64 silverbullet-amd64 silverbullet.exe silverbullet-server-*.zip
|
||||
|
||||
check:
|
||||
# Frontend type check
|
||||
|
||||
@@ -66,7 +66,7 @@ export async function expandMarkdown(
|
||||
const result = await inlineContentFromURL(space, transclusion);
|
||||
|
||||
// We don't transclude anything that's not markdown
|
||||
if (typeof result !== "string") {
|
||||
if (!("text" in result)) {
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export async function expandMarkdown(
|
||||
// it so we won't touch it down the line and cause endless recursion
|
||||
processedPages.add(transclusion.url);
|
||||
|
||||
const tree = parseMarkdown(result);
|
||||
const tree = parseMarkdown(result.text);
|
||||
|
||||
// Recursively process
|
||||
return expandMarkdown(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@silverbulletmd/silverbullet",
|
||||
"version": "2.5.0",
|
||||
"version": "2.5.1",
|
||||
"tasks": {
|
||||
"build": "make clean && deno run -A build_plugs_libraries.ts && deno run -A build_client.ts",
|
||||
"build-production": "deno task build --production",
|
||||
|
||||
@@ -220,7 +220,7 @@ async function renamePage(oldName: string, newName: string) {
|
||||
let newTail = text.substring(link.pos);
|
||||
|
||||
// Only relative links need to be updated
|
||||
if (/^[^/][^\]]+?(?<!]])\)/.test(newTail)) {
|
||||
if (text.substring(link.pos - 2, link.pos) !== "[[") {
|
||||
newLink = absoluteToRelativePath(newName, newLink);
|
||||
newTail = newTail.replace(/^.*?(?=@\d*|#|\$|\))/, newLink);
|
||||
// Wrap in <> if link has spaces
|
||||
@@ -448,7 +448,7 @@ async function updateBacklinks(
|
||||
for (const link of linksInPage) {
|
||||
let newTail = text.substring(link.pos);
|
||||
let newLink = newName;
|
||||
if (/^[^\]]+?(?<!]])\)/.test(newTail)) {
|
||||
if (text.substring(link.pos - 2, link.pos) !== "[[") {
|
||||
// Is [Markdown link]()
|
||||
if (newTail.startsWith("/") || newTail.startsWith("</")) {
|
||||
// Is absolute mdlink, update with full path with leading /
|
||||
|
||||
+12
-8
@@ -17,7 +17,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func buildConfig(bundledFiles fs.FS, args []string) *server.ServerConfig {
|
||||
func buildConfig(bundledFiles fs.FS, args []string, buildTime string) *server.ServerConfig {
|
||||
serverConfig := &server.ServerConfig{
|
||||
BindHost: "127.0.0.1",
|
||||
Port: 3000,
|
||||
@@ -168,13 +168,17 @@ func buildConfig(bundledFiles fs.FS, args []string) *server.ServerConfig {
|
||||
}
|
||||
}
|
||||
|
||||
// Extract the last modified time from the main binary, best effort
|
||||
bundlePathDate := time.Now()
|
||||
if executablePath, err := os.Executable(); err == nil {
|
||||
if stat, err := os.Stat(executablePath); err == nil {
|
||||
bundlePathDate = stat.ModTime()
|
||||
// Determine bundle timestamp from build-time injected value, fall back to current time
|
||||
var bundlePathDate time.Time
|
||||
if buildTime != "" {
|
||||
if t, err := time.Parse(time.RFC3339, buildTime); err == nil {
|
||||
bundlePathDate = t
|
||||
}
|
||||
}
|
||||
if bundlePathDate.IsZero() {
|
||||
log.Println("Couldn't determine build time of binary, falling back to current time stamp")
|
||||
bundlePathDate = time.Now()
|
||||
}
|
||||
|
||||
serverConfig.ClientBundle = server.NewReadOnlyFallthroughSpacePrimitives(bundledFiles, "client", bundlePathDate, nil)
|
||||
rootSpaceConfig.SpacePrimitives = server.NewReadOnlyFallthroughSpacePrimitives(bundledFiles, "base_fs", bundlePathDate, spacePrimitives)
|
||||
@@ -231,7 +235,7 @@ func ensureIndexAndConfig(rootSpaceConfig *server.SpaceConfig) {
|
||||
}
|
||||
}
|
||||
|
||||
func ServerCommand(bundledFiles fs.FS, versionFileText string) *cobra.Command {
|
||||
func ServerCommand(bundledFiles fs.FS, versionFileText string, buildTime string) *cobra.Command {
|
||||
var hostname string
|
||||
var port int
|
||||
var c = &cobra.Command{
|
||||
@@ -242,7 +246,7 @@ func ServerCommand(bundledFiles fs.FS, versionFileText string) *cobra.Command {
|
||||
if version, err := server.ParseVersionFromTypeScript(versionFileText); err == nil {
|
||||
log.Printf("Starting SilverBullet version %s", version)
|
||||
}
|
||||
serverConfig := buildConfig(bundledFiles, args)
|
||||
serverConfig := buildConfig(bundledFiles, args, buildTime)
|
||||
if port != 3000 {
|
||||
serverConfig.Port = port
|
||||
}
|
||||
|
||||
+4
-1
@@ -10,8 +10,11 @@ import (
|
||||
//go:embed public_version.ts
|
||||
var VersionFileText string
|
||||
|
||||
// Set via LDFLAGS
|
||||
var buildTime string
|
||||
|
||||
func main() {
|
||||
c := cmd.ServerCommand(client_bundle.BundledFiles, VersionFileText)
|
||||
c := cmd.ServerCommand(client_bundle.BundledFiles, VersionFileText, buildTime)
|
||||
c.AddCommand(cmd.VersionCommand(VersionFileText), cmd.UpgradeCommand(), cmd.UpgradeEdgeCommand())
|
||||
c.Execute()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
export const version = "2.5.0";
|
||||
export const version = "2.5.1";
|
||||
|
||||
Reference in New Issue
Block a user