Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
test:
name: Test
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run tests
run: go test ./...

build:
name: Build
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Tags are needed so the version stamped into the binary matches
# what a release build would produce.
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Build
run: |
VERSION=$(git describe --tags HEAD 2>/dev/null || echo "Development")
CGO_ENABLED=0 go build -ldflags "-X main.version=${VERSION}" -o gitplm .

- name: Verify version stamp
run: ./gitplm version

lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Check formatting
run: |
if [ -n "$(gofmt -s -l .)" ]; then
echo "Go code is not formatted. Please run 'gofmt -s -w .'"
gofmt -s -l .
exit 1
fi

- name: Run go vet
run: go vet ./...

format-check:
name: Markdown Format Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

# Pinned so a prettier release cannot start failing files that were
# passing. envsetup.sh reads the same file, so gitplm_check locally
# reaches the same verdict as CI.
- name: Install prettier
run: npm install -g "prettier@$(cat .prettier-version)"

- name: Check Markdown formatting
run: prettier --check "**/*.md"
27 changes: 0 additions & 27 deletions .github/workflows/doc-check.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/go.yml

This file was deleted.

15 changes: 9 additions & 6 deletions .github/workflows/release.yml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,33 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

permissions:
contents: write

jobs:
goreleaser:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# GoReleaser needs full history and tags to build the changelog and
# to let scripts/extract-changelog.sh find the tag being released.
fetch-depth: 0

- name: Set up Go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version-file: go.mod

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
version: "~> v2"
args: release --clean --release-notes .release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

version: 2

project_name: gitplm

before:
hooks:
- go mod tidy
Expand Down Expand Up @@ -55,4 +57,6 @@ release:

---

To update, run: `gitplm -update`
To update, run: `gitplm update`

Or download the binary for your platform below and place it in your PATH.
1 change: 1 addition & 0 deletions .prettier-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.5
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,40 @@ For more details or to discuss releases, please visit the

## [Unreleased]

## [0.9.0] - 2026-07-14

- KiCad HTTP API: the server now watches the partmaster directory and reloads
the CSV files when one of them changes, printing a message to the console.
Edits reach KiCad without restarting the server.
- KiCad HTTP API: fields are now served hidden unless configured otherwise.
KiCad displays any field whose visibility is unspecified, so every CSV column
appeared on the schematic when a symbol was placed.
- KiCad HTTP API: added an `http.fields` section to `gitplm.yml` that says, per
IPN category, which column populates KiCad's `Value` field (`value`), which
columns KiCad displays (`visible`), and which are served under a different
field name (`rename`). A category's settings are applied on top of a `default`
section shared by all categories.
- `gitplm update` now works on Windows. It was requesting a download URL without
the `.exe` suffix the released Windows binaries carry, so the update failed.

## [[0.8.12] - 2026-03-02](https://github.com/git-plm/gitplm/releases/tag/v0.8.12)

- Release process now requires a CHANGELOG.md entry for the IPN version being
released. If the entry is missing, the TUI opens `$EDITOR` so the user can add
it before proceeding. The CLI release command also checks and fails with a
clear error.

## [[0.8.11] - 2026-03-02](https://github.com/git-plm/gitplm/releases/tag/v0.8.11)

- TUI: add confirmation prompt before running a release (y/n). Show "Releasing
..." immediately while the release runs asynchronously.

## [[0.8.10] - 2026-03-02](https://github.com/git-plm/gitplm/releases/tag/v0.8.10)

- TUI: release overlay captures log output properly instead of writing to
stderr, constrains width to the terminal, removes timestamps, and truncates
long lines.

## [[0.8.9] - 2026-03-02](https://github.com/git-plm/gitplm/releases/tag/v0.8.9)

- TUI: entering search mode with `/` now immediately reapplies the current
Expand Down
51 changes: 49 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,56 @@ go test ./... # Run all tests
go test -run TestFunctionName ./... # Run a single test
```

No Makefile or linter is configured. CI runs `go test ./...` on every push.
Source `envsetup.sh` for helper functions that mirror what CI does:

Cross-platform releases use GoReleaser (see `envsetup.sh` for helper functions).
```bash
. envsetup.sh
gitplm_build # build with the version stamped in via ldflags
gitplm_test # go test ./...
gitplm_format # gofmt -s -w . and prettier --write on Markdown
gitplm_check # everything CI runs; use this before pushing
```

## CI

`.github/workflows/ci.yaml` runs on every push to `main` and every pull request:
tests, a version-stamped build, `gofmt -s` and `go vet`, and a Prettier check of
all Markdown. `gitplm_check` runs the same set locally.

## Releasing

Pushing a `v*` tag triggers `.github/workflows/release.yaml`, which runs
GoReleaser to build every platform in `.goreleaser.yml` and publish the binaries
to a GitHub release. The release notes are not generated from commits: they are
the `CHANGELOG.md` section for the version being released, extracted by
`scripts/extract-changelog.sh`. If that section is missing, the release fails
rather than publishing empty notes.

To cut a release:

```bash
. envsetup.sh
gitplm_prepare_release 0.8.13 # promotes [Unreleased], commits, tags
git push origin main && git push origin v0.8.13
```

`scripts/prepare-release.sh` refuses to run on a dirty tree, on an existing tag,
or with an empty `[Unreleased]` section, and it runs the tests before tagging.

Notes on keeping the release path working:

- **Every user-visible change needs a `CHANGELOG.md` entry under
`[Unreleased]`.** That entry becomes the release notes, so write it for the
user of `gitplm`, not the engineer changing it: one or two sentences leading
with what they can now do or what was broken and is now fixed. Do not list
file paths or function names. Entries sit directly under each other with no
blank line between them; the blank line separates one version section from the
next.
- **The published asset names are a contract with `gitplm update`.** The
`archives` `name_template` in `.goreleaser.yml` names the files attached to
the release, and `binaryName` in `update.go` reconstructs those names to build
the download URL. `TestBinaryName` pins the two together against the names
actually published. Change one and you must change the other.

## Architecture

Expand Down
Loading
Loading