Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
dist
coverage.out
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches:
- "**"
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go: ["1.24", "1.25"]

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

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Download modules
run: go mod download

- name: Check formatting
run: test -z "$(gofmt -l ./cmd ./internal)"

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

- name: Test
run: go test ./...

- name: Smoke
run: bash ./scripts/smoke.sh
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.25"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 4 additions & 42 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,43 +1,5 @@
dist/
coverage.out
*.test
*.out
.DS_Store
*.swp
.tags*
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/test/
/test/version_tmp/
/tmp/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalisation:
/.bundle/
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Gemfile.lock
.ruby-version
.ruby-gemset
.rubocop_todo.yml
.rubocop.yml

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
.Gemfile.lock

# Unfinished Commands
/lib/cartero/commands/whatsapp.rb
44 changes: 44 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
project_name: cartero

before:
hooks:
- go mod tidy
- go test ./...

builds:
- id: cartero
main: ./cmd/cartero
binary: cartero
env:
- CGO_ENABLED=0
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -X github.com/Section9Labs/Cartero/internal/version.Version={{ .Version }}
- -X github.com/Section9Labs/Cartero/internal/version.Commit={{ .Commit }}
- -X github.com/Section9Labs/Cartero/internal/version.Date={{ .Date }}

archives:
- id: default
formats:
- tar.gz
format_overrides:
- goos: windows
formats:
- zip

checksum:
name_template: checksums.txt

release:
draft: false
prerelease: auto

changelog:
use: git
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

102 changes: 0 additions & 102 deletions CHANGELOG.md

This file was deleted.

14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.25-alpine AS build

WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o /out/cartero ./cmd/cartero

FROM gcr.io/distroless/static-debian12

COPY --from=build /out/cartero /usr/local/bin/cartero
ENTRYPOINT ["/usr/local/bin/cartero"]
CMD ["--help"]
36 changes: 0 additions & 36 deletions Gemfile

This file was deleted.

30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
APP_NAME := cartero
DIST_DIR := dist

.PHONY: bootstrap fmt vet test build smoke clean docker-build

bootstrap:
go mod tidy

fmt:
gofmt -w ./cmd ./internal

vet:
go vet ./...

test:
go test ./...

build:
mkdir -p $(DIST_DIR)
go build -o $(DIST_DIR)/$(APP_NAME) ./cmd/cartero

smoke:
bash ./scripts/smoke.sh

docker-build:
docker build -t $(APP_NAME):dev .

clean:
rm -rf $(DIST_DIR)

Loading
Loading