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
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
updates:
# Enable version updates for Go modules
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
reviewers:
- "pseudomuto"
assignees:
- "pseudomuto"
commit-message:
prefix: "deps"
include: "scope"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
reviewers:
- "pseudomuto"
assignees:
- "pseudomuto"
commit-message:
prefix: "ci"
include: "scope"

62 changes: 36 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,58 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.24", "1.25"]

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true

- name: Install Task
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v20

- name: Download dependencies
run: go mod download
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v13

- name: Run tests
run: task test:ci
run: nix develop -c task test:ci

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: ./coverage.out
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

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

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v20

- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v13

- name: Run linter
run: nix develop -c task lint

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

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

- name: Install Task
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v20

- name: Run linting
run: task lint
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v13

- name: Run GoReleaser (no publish)
run: nix develop -c task build
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write
packages: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v20

- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v13

- name: Run GoReleaser
run: nix develop -c goreleaser release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin/
.direnv/
dist/
65 changes: 65 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: 2

# Project metadata
project_name: where

# Build configuration
builds:
- skip: true

# Archive configuration
archives:
- id: default
ids:
- where
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- LICENSE.txt
- README.md

# Checksum configuration
checksum:
name_template: "checksums.txt"

# Snapshot configuration
snapshot:
version_template: "{{ incpatch .Version }}-next"

# Changelog configuration
changelog:
sort: asc
use: github
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
- "^build:"
- "^chore:"
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: Bug Fixes
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: Others
order: 999

# Release configuration
release:
github:
owner: pseudomuto
name: where
draft: false
prerelease: auto
name_template: "Release {{ .Version }}"
header: |
## Where - A SQL where clause parser.

### Installation

`go get github.com/pseudomuto/where`

footer: |
**Full Changelog**: https://github.com/pseudomuto/where/compare/{{ .PreviousTag }}...{{ .Tag }}
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
description = "Where - A SQL where clause parser";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachSystem
[
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
]
(
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};

# Pick language/tool versions here (adjust as you like)
go = pkgs.go_1_25;

# Common build utils
buildUtils = with pkgs; [
go-task
golangci-lint
goreleaser
];
in
{
# `nix develop` drops you into this shell
devShells.default = pkgs.mkShell {
packages = [
go
buildUtils
];

CGO_ENABLED = "0";

# Helpful prompt when you enter the shell
shellHook = ''
echo "▶ Dev shell ready on ${system}"
echo " Go: $(${go}/bin/go version)"
'';
};

# `nix fmt` to format nix files in this repo
formatter = pkgs.nixfmt-tree;
}
);
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.24.4

require (
github.com/alecthomas/participle/v2 v2.1.1
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading