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
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
push:
branches:
- main
pull_request:

jobs:
lint:
name: Run on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v4

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

- name: Run linter
uses: golangci/golangci-lint-action@v8
with:
version: v2.1.6
73 changes: 73 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release Please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
packages: write

jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- name: Run Release Please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

goreleaser:
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: dist/*
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests

on:
push:
branches:
- main
pull_request:

jobs:
test:
name: Run on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v4

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

- name: Running Tests
run: |
go mod tidy
make test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ go.work.sum
issue-analysis-report.md
*.tar.gz

# GoReleaser
dist/

# Local configuration
.env
.envrc
Expand Down
39 changes: 39 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "2"
run:
allow-parallel-runners: true
linters:
default: none
enable:
- copyloopvar
- dupl
- errcheck
- goconst
- gocyclo
- govet
- ineffassign
- lll
- misspell
- nakedret
- prealloc
- revive
- staticcheck
- unconvert
- unparam
- unused
settings:
lll:
line-length: 140
revive:
rules:
- name: comment-spacings
- name: import-shadowing
exclusions:
rules:
# Allow longer lines in analyzer (LLM prompts)
- linters:
- lll
path: internal/analyzer/
formatters:
enable:
- gofmt
- goimports
178 changes: 178 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# GoReleaser configuration for IssueParser
# https://goreleaser.com/customization/

version: 2

before:
hooks:
- go mod tidy

builds:
- id: issueparser
main: ./cmd/issueparser
binary: issueparser

# Build for Linux and macOS
goos:
- linux
- darwin

goarch:
- amd64
- arm64

env:
- CGO_ENABLED=0

ldflags:
- -s -w

archives:
- id: issueparser
builds:
- issueparser

name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

files:
- LICENSE
- README.md

checksum:
name_template: "checksums.txt"
algorithm: sha256

dockers:
- id: issueparser-amd64
goos: linux
goarch: amd64
ids:
- issueparser
image_templates:
- "ghcr.io/defilan/issueparser:{{ .Version }}-amd64"
- "ghcr.io/defilan/issueparser:latest-amd64"
dockerfile: Dockerfile.goreleaser
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"

- id: issueparser-arm64
goos: linux
goarch: arm64
ids:
- issueparser
image_templates:
- "ghcr.io/defilan/issueparser:{{ .Version }}-arm64"
- "ghcr.io/defilan/issueparser:latest-arm64"
dockerfile: Dockerfile.goreleaser
use: buildx
build_flag_templates:
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"

docker_manifests:
- name_template: "ghcr.io/defilan/issueparser:{{ .Version }}"
image_templates:
- "ghcr.io/defilan/issueparser:{{ .Version }}-amd64"
- "ghcr.io/defilan/issueparser:{{ .Version }}-arm64"

- name_template: "ghcr.io/defilan/issueparser:latest"
image_templates:
- "ghcr.io/defilan/issueparser:latest-amd64"
- "ghcr.io/defilan/issueparser:latest-arm64"

snapshot:
version_template: "{{ incpatch .Version }}-next"

changelog:
sort: asc
use: github

filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
- "^chore:"
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch

groups:
- title: "New Features"
regexp: "^feat:"
order: 0
- title: "Bug Fixes"
regexp: "^fix:"
order: 1
- title: "Performance Improvements"
regexp: "^perf:"
order: 2
- title: "Other Changes"
order: 999

release:
github:
owner: defilan
name: issueparser

name_template: "v{{.Version}}"

draft: false

replace_existing_draft: true

# Keep Release Please's changelog, just add assets
mode: keep-existing

footer: |
---

## Installation

### Docker
```bash
docker pull ghcr.io/defilan/issueparser:{{ .Version }}
```

### Manual Download

**macOS**
```bash
# ARM64 (Apple Silicon)
curl -L https://github.com/defilan/issueparser/releases/download/v{{ .Version }}/issueparser_{{ .Version }}_darwin_arm64.tar.gz | tar xz
sudo mv issueparser /usr/local/bin/

# AMD64
curl -L https://github.com/defilan/issueparser/releases/download/v{{ .Version }}/issueparser_{{ .Version }}_darwin_amd64.tar.gz | tar xz
sudo mv issueparser /usr/local/bin/
```

**Linux**
```bash
# AMD64
curl -L https://github.com/defilan/issueparser/releases/download/v{{ .Version }}/issueparser_{{ .Version }}_linux_amd64.tar.gz | tar xz
sudo mv issueparser /usr/local/bin/

# ARM64
curl -L https://github.com/defilan/issueparser/releases/download/v{{ .Version }}/issueparser_{{ .Version }}_linux_arm64.tar.gz | tar xz
sudo mv issueparser /usr/local/bin/
```

### Verify Installation
```bash
issueparser --help
```

metadata:
mod_timestamp: "{{ .CommitTimestamp }}"
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
Loading
Loading