Skip to content

Commit 32bb842

Browse files
author
Michael Henriksen
committed
feat: initial commit
0 parents  commit 32bb842

34 files changed

+3046
-0
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Release
3+
permissions:
4+
contents: write
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: "Release version (e.g., v1.0.0)"
10+
required: true
11+
jobs:
12+
run:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- run: git fetch --force --tags
21+
- name: Install Go
22+
uses: actions/setup-go@v4
23+
with:
24+
go-version-file: "go.mod"
25+
cache-dependency-path: "go.sum"
26+
go-version: "1.21"
27+
- run: echo "GO_VERSION=$(go env GOVERSION)" >> "$GITHUB_ENV"
28+
- name: Create release tag
29+
run: |
30+
git config --global user.email "mchnrksn@gmail.com"
31+
git config --global user.name "Michael Henriksen"
32+
git tag -a "$VERSION" -m "$VERSION"
33+
env:
34+
VERSION: ${{ github.event.inputs.version }}
35+
- name: Run GoReleaser
36+
uses: goreleaser/goreleaser-action@v4
37+
with:
38+
distribution: goreleaser
39+
version: latest
40+
args: release --clean
41+
env:
42+
APP_NAME: pkgdmp
43+
VERSION: ${{ github.event.inputs.version }}
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
GOPATH: ${{ github.workspace }}/go
46+
- name: Notify Go proxy about new release
47+
run: go list -m "github.com/michenriksen/pkgdmp@${VERSION}" || true
48+
env:
49+
GOPROXY: proxy.golang.org
50+
VERSION: ${{ github.event.inputs.version }}

.github/workflows/verify.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Verify
3+
permissions:
4+
contents: read
5+
on:
6+
push:
7+
branches: [main]
8+
paths:
9+
- "go.mod"
10+
- "**/*.go"
11+
pull_request:
12+
branches: [main]
13+
paths:
14+
- "go.mod"
15+
- "**/*.go"
16+
schedule:
17+
- cron: "0 10 * * 1"
18+
workflow_call:
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
jobs:
23+
verify:
24+
name: Verify
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 5
27+
strategy:
28+
fail-fast: true
29+
steps:
30+
- name: Check out code
31+
uses: actions/checkout@v3
32+
- name: Install Go
33+
uses: actions/setup-go@v4
34+
with:
35+
go-version-file: "go.mod"
36+
cache-dependency-path: "go.sum"
37+
go-version: "1.21"
38+
- name: Install golangci-lint
39+
run: |
40+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
41+
- name: Run make verify
42+
run: make verify

.gitignore

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/go,vim,visualstudiocode,macos,linux
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=go,vim,visualstudiocode,macos,linux
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file
25+
go.work
26+
27+
### Linux ###
28+
*~
29+
30+
# temporary files which can be created if a process still has a handle open of a deleted file
31+
.fuse_hidden*
32+
33+
# KDE directory preferences
34+
.directory
35+
36+
# Linux trash folder which might appear on any partition or disk
37+
.Trash-*
38+
39+
# .nfs files are created when an open file is removed but is still being accessed
40+
.nfs*
41+
42+
### macOS ###
43+
# General
44+
.DS_Store
45+
.AppleDouble
46+
.LSOverride
47+
48+
# Icon must end with two \r
49+
Icon
50+
51+
52+
# Thumbnails
53+
._*
54+
55+
# Files that might appear in the root of a volume
56+
.DocumentRevisions-V100
57+
.fseventsd
58+
.Spotlight-V100
59+
.TemporaryItems
60+
.Trashes
61+
.VolumeIcon.icns
62+
.com.apple.timemachine.donotpresent
63+
64+
# Directories potentially created on remote AFP share
65+
.AppleDB
66+
.AppleDesktop
67+
Network Trash Folder
68+
Temporary Items
69+
.apdisk
70+
71+
### macOS Patch ###
72+
# iCloud generated files
73+
*.icloud
74+
75+
### Vim ###
76+
# Swap
77+
[._]*.s[a-v][a-z]
78+
!*.svg # comment out if you don't need vector files
79+
[._]*.sw[a-p]
80+
[._]s[a-rt-v][a-z]
81+
[._]ss[a-gi-z]
82+
[._]sw[a-p]
83+
84+
# Session
85+
Session.vim
86+
Sessionx.vim
87+
88+
# Temporary
89+
.netrwhist
90+
# Auto-generated tag files
91+
tags
92+
# Persistent undo
93+
[._]*.un~
94+
95+
### VisualStudioCode ###
96+
.vscode/*
97+
!.vscode/settings.json
98+
!.vscode/tasks.json
99+
!.vscode/launch.json
100+
!.vscode/extensions.json
101+
!.vscode/*.code-snippets
102+
103+
# Local History for Visual Studio Code
104+
.history/
105+
106+
# Built Visual Studio Code Extensions
107+
*.vsix
108+
109+
### VisualStudioCode Patch ###
110+
# Ignore all local history of files
111+
.history
112+
.ionide
113+
114+
# End of https://www.toptal.com/developers/gitignore/api/go,vim,visualstudiocode,macos,linux
115+
116+
/build
117+
/dist

.golangci.yml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
run:
3+
tests: false
4+
go: "1.20"
5+
issues:
6+
exclude:
7+
- 'declaration of "err" shadows declaration at line'
8+
linters:
9+
disable-all: true
10+
enable:
11+
- bidichk
12+
- depguard
13+
- errcheck
14+
- errname
15+
- forcetypeassert
16+
- gocheckcompilerdirectives
17+
- gocritic
18+
- godot
19+
- gofumpt
20+
- goimports
21+
- gosec
22+
- gosimple
23+
- ineffassign
24+
- makezero
25+
- misspell
26+
- nolintlint
27+
- prealloc
28+
- revive
29+
- staticcheck
30+
- tenv
31+
- testpackage
32+
- thelper
33+
- typecheck
34+
- unused
35+
- usestdlibvars
36+
- wrapcheck
37+
- wsl
38+
linters-settings:
39+
depguard:
40+
rules:
41+
main:
42+
deny:
43+
- pkg: github.com/go-ozzo/ozzo-validation
44+
desc: "use maintained github.com/invopop/validation fork instead"
45+
godot:
46+
period: true
47+
capital: true
48+
gofumpt:
49+
extra-rules: true
50+
nolintlint:
51+
require-explanation: true
52+
require-specific: true
53+
revive:
54+
rules:
55+
- name: argument-limit
56+
severity: warning
57+
disabled: false
58+
arguments: [4]
59+
- name: atomic
60+
severity: warning
61+
disabled: false
62+
- name: bool-literal-in-expr
63+
severity: warning
64+
disabled: false
65+
- name: comment-spacings
66+
severity: warning
67+
disabled: false
68+
arguments:
69+
- nolint
70+
- "#nosec"
71+
- name: constant-logical-expr
72+
severity: warning
73+
disabled: false
74+
- name: context-as-argument
75+
severity: warning
76+
disabled: false
77+
- name: context-keys-type
78+
severity: warning
79+
disabled: false
80+
- name: datarace
81+
severity: warning
82+
disabled: false
83+
- name: deep-exit
84+
severity: warning
85+
disabled: false
86+
- name: defer
87+
severity: warning
88+
disabled: false
89+
- name: duplicated-imports
90+
severity: warning
91+
disabled: false
92+
- name: early-return
93+
severity: warning
94+
disabled: false
95+
- name: empty-block
96+
severity: warning
97+
disabled: false
98+
- name: error-return
99+
severity: warning
100+
disabled: false
101+
- name: error-strings
102+
severity: warning
103+
disabled: false
104+
- name: errorf
105+
severity: warning
106+
disabled: false
107+
- name: function-result-limit
108+
severity: warning
109+
disabled: false
110+
arguments: [3]
111+
- name: identical-branches
112+
severity: warning
113+
disabled: false
114+
- name: if-return
115+
severity: warning
116+
disabled: false
117+
- name: increment-decrement
118+
severity: warning
119+
disabled: false
120+
- name: import-shadowing
121+
severity: warning
122+
disabled: false
123+
- name: line-length-limit
124+
severity: warning
125+
disabled: false
126+
arguments: [120]
127+
- name: modifies-parameter
128+
severity: warning
129+
disabled: false
130+
- name: modifies-value-receiver
131+
severity: warning
132+
disabled: false
133+
- name: optimize-operands-order
134+
severity: warning
135+
disabled: false
136+
- name: range
137+
severity: warning
138+
disabled: false
139+
- name: range-val-in-closure
140+
severity: warning
141+
disabled: false
142+
- name: range-val-address
143+
severity: warning
144+
disabled: false
145+
- name: redefines-builtin-id
146+
severity: warning
147+
disabled: false
148+
- name: string-of-int
149+
severity: warning
150+
disabled: false
151+
- name: struct-tag
152+
severity: warning
153+
disabled: false
154+
- name: var-naming
155+
severity: warning
156+
disabled: false
157+
- name: var-declaration
158+
severity: warning
159+
disabled: false
160+
- name: unconditional-recursion
161+
severity: warning
162+
disabled: false
163+
- name: unnecessary-stmt
164+
severity: warning
165+
disabled: false
166+
- name: unreachable-code
167+
severity: warning
168+
disabled: false
169+
- name: unused-parameter
170+
severity: warning
171+
disabled: false
172+
- name: unused-receiver
173+
severity: warning
174+
disabled: false
175+
- name: use-any
176+
severity: warning
177+
disabled: false

0 commit comments

Comments
 (0)