From d25bd5c5caa96567f5844fe40b3fca913c3a9102 Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 4 Nov 2025 12:00:58 +0000 Subject: [PATCH] Add GoReleaser configuration and update Go version to 1.25 Signed-off-by: Snider --- .github/workflows/release.yml | 36 +++++++++++++++ .goreleaser.yaml | 85 +++++++++++++++++++++++++++++++++++ README.md | 28 +++++++++--- cmd/core/go.mod | 2 +- docs/requirements.txt | 4 ++ go.work | 2 +- 6 files changed, 148 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml create mode 100644 docs/requirements.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..419d0d88 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: release + +on: + push: + tags: + - 'v*.*.*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version: '1.25' + check-latest: true + - name: Set up Node (for GUI builds if needed) + uses: actions/setup-node@v4 + with: + node-version: '22' + - name: Install Wails (optional) + run: | + go install github.com/wailsapp/wails/v3/cmd/wails3@latest || true + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..2d540605 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,85 @@ +# Minimal Goreleaser configuration for Snider/Core +# No functional changes to the codebase, just release automation. + +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - id: core-cli + main: ./cmd/core + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + flags: + - -trimpath + ldflags: + - -s -w + mod_timestamp: '{{ .CommitDate }}' + binary: core + + - id: core-gui + # Wails GUI apps often require CGO and platform specifics; we keep a minimal build here. + # If GUI builds need special handling, they can be adjusted later. + main: ./cmd/core-gui + env: + - CGO_ENABLED=1 + goos: + - darwin + - windows + - linux + goarch: + - amd64 + - arm64 + flags: + - -trimpath + ldflags: + - -s -w + mod_timestamp: '{{ .CommitDate }}' + binary: core-gui + +archives: + - id: default + builds: + - core-cli + - core-gui + name_template: >- + {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }} + formats: + - tar.gz + format_overrides: + - goos: windows + formats: [zip] + files: + - LICENSE.txt + - README.md + +checksum: + name_template: 'checksums.txt' + +dockers: [] + +nfpms: [] + +changelog: + use: github + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + +release: + github: + owner: Snider + name: Core + draft: false + prerelease: auto diff --git a/README.md b/README.md index efe9edea..77f8726d 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ The project is organized into the following main directories: ## Prerequisites -- [Go](https://go.dev/) +- Go 1.25+ (this repo targets Go 1.25 and uses workspaces) - [Node.js](https://nodejs.org/) - [Wails](https://wails.io/) - [Task](https://taskfile.dev/) @@ -127,11 +127,25 @@ These tasks are run from the root directory and operate on the CLI application. - `task cli:test-gen`: Generates tests for the public API. ## Docs (MkDocs) -The help site and in‑app docs are built with MkDocs Material and live under `pkg/v1/core/docs`. +The documentation site is powered by MkDocs Material and lives under `docs/` with configuration in `mkdocs.yml`. -- Live preview: from `pkg/v1/core/docs` run - - `pip install -r requirements.txt` - - `mkdocs serve -o -c` (or `task dev` if you use Task) -- Build static site: `mkdocs build --clean -d public` (or `task build`) +- Install docs tooling: + - `pip install -r docs/requirements.txt` +- Live preview from repository root: + - `mkdocs serve -o -c` +- Build static site: + - `mkdocs build --clean` -The demo app embeds the built docs from `public/` and can open specific sections in new windows using stable, short headings. +## Releasing (GoReleaser) +This repo includes a minimal GoReleaser config (`.goreleaser.yaml`). Tagged pushes like `v1.2.3` will build and publish archives via GitHub Actions (see `.github/workflows/release.yml`). + +- Local dry run: `goreleaser release --snapshot --clean` +- Real release: create and push a version tag `vX.Y.Z`. + +## Go Workspaces +This repository uses Go workspaces (`go.work`) targeting Go 1.25. + +- Add/remove modules with `go work use`. +- Typical workflow: + - `go work sync` + - `go mod tidy` in modules as needed diff --git a/cmd/core/go.mod b/cmd/core/go.mod index 86d1656c..7dfa0be1 100644 --- a/cmd/core/go.mod +++ b/cmd/core/go.mod @@ -1,6 +1,6 @@ module github.com/Snider/Core/cmd/core -go 1.23.0 +go 1.25 require ( github.com/charmbracelet/lipgloss v1.1.0 diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..31c00a5f --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +mkdocs>=1.6.0 +mkdocs-material>=9.5.0 +mkdocs-material-extensions>=1.3 +pymdown-extensions>=10.8 diff --git a/go.work b/go.work index 5db5bbcf..1b7697aa 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.25.3 +go 1.25 use ( .