Initial release
All checks were successful
CI / Build (push) Successful in 46s

This commit is contained in:
Leon Mika 2026-05-24 16:27:46 +10:00
commit ed45fa303c
9 changed files with 290 additions and 0 deletions

View file

@ -0,0 +1,23 @@
name: CI
on:
push:
branches:
- main
- feature/*
jobs:
Build:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.25
- name: Test
run: |
set -xue
go get ./...
go test -p 1 ./...

View file

@ -0,0 +1,101 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
Build:
runs-on: docker
services:
localstack:
image: localstack/localstack
ports:
- "4566:4566"
env:
SERVICES: ssm,dynamodb
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.25
- name: Configure
run: |
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/lmika".insteadOf "https://github.com/lmika"
- name: Test
run: |
set -xue
go get ./...
go test -p 1 ./...
env:
TEST_DYNAMO_URL: "http://localstack:4566"
GOPRIVATE: "github:com/lmika/*"
# Site:
# needs: Build
# runs-on: docker
# env:
# NETLIFY_SITE_ID: set me
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup Go
# uses: actions/setup-go@v3
# with:
# go-version: 1.24
# - uses: actions/setup-node@v4
# with:
# node-version: 21.1
# - name: Install Hugo
# run: |
# curl -LO https://github.com/gohugoio/hugo/releases/download/v0.146.0/hugo_extended_0.146.0_linux-amd64.deb
# apt install -y ./hugo_extended_0.146.0_linux-amd64.deb
# - name: Install Netlify CLI
# run: |
# npm install netlify-cli@15.0.1 -g
# - name: Build Site
# run: |
# cd _site
# mkdir -p themes
# git clone https://github.com/alex-shpak/hugo-book.git themes/hugo-book
# npm install
# hugo --minify
# - name: Publish Site
# run: |
# cd _site
# netlify deploy --dir docs --prod
'Release MacOS':
# needs: Build
runs-on: macos
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.25
- name: Setup Dependencies
run: |
brew install gpg
- name: Configure
run: |
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/lmika".insteadOf "https://github.com/lmika"
- name: Setup Goreleaser
run: |
go install github.com/goreleaser/goreleaser/v2@v2.12.7
- name: Release
run: |
goreleaser release -f goreleaser.yml --skip=validate --clean
env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_PRIVATE_KEY: ${{ secrets.HOMEBREW_TAP_PRIVATE_KEY }}
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea/

0
LICENSE Normal file
View file

51
cmd/root.go Normal file
View file

@ -0,0 +1,51 @@
/*
Copyright © 2026 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
"os"
"github.com/spf13/cobra"
)
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "csvutils",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.csvutils.yaml)")
// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}

9
go.mod Normal file
View file

@ -0,0 +1,9 @@
module lmika.dev/cmd/csvutils
go 1.26.3
require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
)

11
go.sum Normal file
View file

@ -0,0 +1,11 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

83
goreleaser.yml Normal file
View file

@ -0,0 +1,83 @@
version: 2
builds:
- id: macos
targets:
- darwin_amd64
- darwin_arm64
env:
- CGO_ENABLED=0
main: .
binary: csvutils
- id: linux
targets:
- linux_amd64
- linux_arm64
env:
- CGO_ENABLED=0
main: .
binary: ted
notarize:
macos:
- enabled: true
ids:
- macos
sign:
certificate: "{{.Env.MACOS_SIGN_P12}}"
password: "{{.Env.MACOS_SIGN_PASSWORD}}"
notarize:
issuer_id: "{{.Env.MACOS_NOTARY_ISSUER_ID}}"
key_id: "{{.Env.MACOS_NOTARY_KEY_ID}}"
key: "{{.Env.MACOS_NOTARY_KEY}}"
wait: true
timeout: 20m
archives:
- id: macos_tgz
ids:
- macos
wrap_in_directory: false
formats:
- tar.gz
- id: linux_tgz
ids:
- linux
wrap_in_directory: false
formats:
- tar.gz
release:
gitea:
owner: cmd
name: ted
ids:
- macos_tgz
- linux_tgz
homebrew_casks:
- name: csvutils
ids:
- macos
repository:
owner: casks
name: dynamo-browse
git:
url: 'forgejo@lmika.dev:casks/ted.git'
private_key: "{{ .Env.HOMEBREW_TAP_PRIVATE_KEY }}"
directory: Casks
homepage: https://ted.lmika.dev/
description: TUI tools for working with CSV files
license: MIT
checksum:
name_template: 'checksums-macos.txt'
snapshot:
version_template: "{{ .Tag }}-next"
gitea_urls:
api: https://lmika.dev/api/v1
download: https://lmika.dev
# set to true if you use a self-signed certificate
skip_tls_verify: false

11
main.go Normal file
View file

@ -0,0 +1,11 @@
/*
Copyright © 2026 NAME HERE <EMAIL ADDRESS>
*/
package main
import "lmika.dev/cmd/csvutils/cmd"
func main() {
cmd.Execute()
}