diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md index a987aa4b..d148df46 100644 --- a/.github/ISSUE_TEMPLATE/issue-template.md +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -1,12 +1,12 @@ --- name: Issue Template -about: - A template for submitting bug reports, feature requests, or support inquiries - for Sylve, with sections for behavior, reproduction steps, environment, - and additional context. +about: A template for submitting bug reports, feature requests, or support inquiries + for Sylve, with sections for behavior, reproduction steps, environment, and additional + context. title: "[Bug/Feature/Support] Brief Description of the Issue" -labels: "" +labels: '' assignees: hayzamjs + --- - **I'm submitting a**: @@ -28,7 +28,7 @@ assignees: hayzamjs - **Please tell us about your environment** - **Version**: x.x.x - - **Operating System** (where sylve is running): FreeBSD 14.x (Only >= 14.2 is supported) + - **Operating System** (where sylve is running): FreeBSD 15.x (Only >= 15.0 is officially supported) - **Browser**: [all | Chrome XX | Firefox XX | Safari XX ] - Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, discord, etc) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 748c7e09..e7898630 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,17 +1,63 @@ -name: Build +name: Build Sylve on: [push] + jobs: - build: + build-web: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Build + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 24 + - name: Build Web Assets + run: | + npm install --prefix web + npm run build --prefix web + mkdir -p internal/assets/web-files + cp -rf web/build/* internal/assets/web-files/ + - name: Upload Web Assets + uses: actions/upload-artifact@v4 + with: + name: web-assets + path: internal/assets/web-files/ + + build-freebsd: + needs: build-web + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - arch: amd64 + vm_arch: x86_64 + - arch: arm64 + vm_arch: aarch64 + + steps: + - uses: actions/checkout@v4 + + - name: Download Web Assets + uses: actions/download-artifact@v4 + with: + name: web-assets + path: internal/assets/web-files + + - name: Build on FreeBSD ${{ matrix.arch }} uses: vmactions/freebsd-vm@v1 with: + arch: ${{ matrix.vm_arch }} + sync: scp usesh: true - prepare: pkg install -y node24 npm-node24 go git + prepare: pkg install -y go git run: | - export GOPATH=$HOME/go - export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin - chmod +x scripts/build-deps-check.sh - make + mkdir -p bin + # Build using the specific architecture + CGO_ENABLED=1 GOOS=freebsd GOARCH=${{ matrix.arch }} \ + go build -o bin/sylve-${{ matrix.arch }} cmd/sylve/main.go + + - name: Upload Binary + uses: actions/upload-artifact@v4 + with: + name: sylve-${{ matrix.arch }} + path: bin/sylve-${{ matrix.arch }} diff --git a/Makefile b/Makefile index 323a2c1e..f511c869 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,25 @@ BINARY_NAME := sylve BIN_DIR := bin +ARCH ?= amd64 -.PHONY: all build clean run depcheck +.PHONY: all build clean web-build all: build -build: build-depcheck - npm install --prefix web - npm run build --prefix web - cp -rf web/build/* internal/assets/web-files +build: mkdir -p $(BIN_DIR) - go build -o $(BIN_DIR)/$(BINARY_NAME) cmd/sylve/main.go - -clean: - rm -rf $(BIN_DIR) - -run: build - ./$(BIN_DIR)/$(BINARY_NAME) + CGO_ENABLED=1 GOOS=freebsd GOARCH=$(ARCH) \ + go build -o $(BIN_DIR)/$(BINARY_NAME)-$(ARCH) cmd/sylve/main.go test: go test ./... -build-depcheck: - @./scripts/build-deps-check.sh +web-build: + npm install --prefix web + npm run build --prefix web + mkdir -p internal/assets/web-files + cp -rf web/build/* internal/assets/web-files/ + +clean: + rm -rf $(BIN_DIR) + rm -rf internal/assets/web-files/* \ No newline at end of file diff --git a/go.mod b/go.mod index f53595e2..08bf551f 100644 --- a/go.mod +++ b/go.mod @@ -30,6 +30,7 @@ require ( github.com/hashicorp/raft-boltdb/v2 v2.3.1 github.com/klauspost/cpuid/v2 v2.3.0 github.com/mackerelio/go-osstat v0.2.6 + github.com/mattn/go-isatty v0.0.20 github.com/mattn/go-sqlite3 v1.14.32 github.com/msteinert/pam v1.2.0 github.com/natefinch/lumberjack v2.0.0+incompatible @@ -116,7 +117,6 @@ require ( github.com/klauspost/compress v1.18.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 820fc1d6..e5820c4b 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -15,6 +15,7 @@ import ( "sync" "time" + "github.com/mattn/go-isatty" "github.com/natefinch/lumberjack" "github.com/rs/zerolog" "github.com/rs/zerolog/log" @@ -48,7 +49,7 @@ func InitLogger(dataDir string, level int8) { consoleWriter := zerolog.ConsoleWriter{ Out: os.Stderr, TimeFormat: "2006/01/02 15:04:05", - NoColor: false, + NoColor: !isatty.IsTerminal(os.Stderr.Fd()), } fileWriter := &lumberjack.Logger{