Skip to content

Commit 917d5e2

Browse files
committed
update public repo to current state of gloomberg
1 parent 1794f54 commit 917d5e2

File tree

170 files changed

+18292
-372301
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+18292
-372301
lines changed

.github/dependabot.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
4+
# maintain dependencies for GitHub actions
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
10+
# maintain dependencies for Go modules
11+
- package-ecosystem: "gomod"
12+
directory: "/"
13+
schedule:
14+
interval: "daily"

.github/workflows/build.yml

+11-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
name: gloomberg build
1+
name: build
22

33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
build:
77
runs-on: ubuntu-latest
8-
permissions:
9-
contents: write
10-
packages: write
8+
# runs-on: self-hosted
9+
permissions: { contents: write, packages: write }
1110

1211
env:
1312
REGISTRY: ghcr.io
@@ -16,39 +15,35 @@ jobs:
1615
steps:
1716
- name: Checkout
1817
uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0
18+
with: { fetch-depth: 0 }
2119

2220
- name: Log in to the Container registry
23-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
21+
uses: docker/login-action@v2
2422
with:
2523
registry: ${{ env.REGISTRY }}
2624
username: ${{ github.actor }}
2725
password: ${{ secrets.GITHUB_TOKEN }}
2826

2927
- name: Set up Go
30-
uses: actions/setup-go@v3
31-
with:
32-
go-version: ">=1.19.0"
33-
check-latest: true
34-
# cache: true
28+
uses: actions/setup-go@v4
29+
with: { cache: true, check-latest: true, go-version-file: "go.mod" }
3530

3631
- name: Run GoReleaser (snapshot)
37-
uses: goreleaser/goreleaser-action@v3
32+
uses: goreleaser/goreleaser-action@v4
3833
if: "!startsWith(github.ref, 'refs/tags/')"
3934
with:
4035
version: latest
41-
args: build --rm-dist --snapshot
36+
args: build --clean --snapshot
4237
env:
4338
REGISTRY: ${{ env.REGISTRY }}
4439
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4540

4641
- name: Run GoReleaser (release)
47-
uses: goreleaser/goreleaser-action@v3
42+
uses: goreleaser/goreleaser-action@v4
4843
if: startsWith(github.ref, 'refs/tags/')
4944
with:
5045
version: latest
51-
args: release --rm-dist
46+
args: release --clean
5247
env:
5348
REGISTRY: ${{ env.REGISTRY }}
5449
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: docs
2+
3+
on:
4+
push: { branches: [master, main] }
5+
workflow_dispatch:
6+
7+
permissions: { contents: write }
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
if: github.event.repository.fork == false
13+
14+
env:
15+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- uses: actions/setup-python@v4
21+
with: { python-version: 3.x }
22+
23+
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
24+
25+
- run: mkdocs gh-deploy --force

.github/workflows/golangci-lint.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: golangci-lint
2+
3+
on:
4+
pull_request:
5+
push: { branches: [master, main], tags: [v*] }
6+
workflow_dispatch:
7+
8+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
9+
permissions: { contents: read } # pull-requests: read
10+
11+
jobs:
12+
golangci:
13+
name: lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with: { cache: true, check-latest: true, go-version-file: "go.mod" }
21+
22+
- name: golangci-lint
23+
uses: golangci/golangci-lint-action@v3
24+
with: { version: latest }

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,14 @@ dist/
77

88
# misc
99
internal/assets
10+
metadata/
1011
dev.md
12+
*.sqlite
13+
.idea
14+
15+
# testing
16+
cmd/rawtx.go
17+
ranks/
18+
19+
# not ready for prime time
20+
deployment/

.golangci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
run:
2+
timeout: 3m
3+
4+
# never fail
5+
issues-exit-code: 0
6+
7+
linters:
8+
enable-all: true
9+
disable:
10+
- gochecknoglobals
11+
- gomnd
12+
- lll
13+
- funlen
14+
- exhaustivestruct
15+
- exhaustruct
16+
- tagliatelle
17+
- forbidigo
18+
- varnamelen
19+
- wrapcheck
20+
- nestif
21+
- gocognit
22+
- cyclop
23+
- gocyclo
24+
- ireturn
25+
- gochecknoinits
26+
- goerr113
27+
- maligned
28+
- exhaustive
29+
- interfacer
30+
- nilnil

.goreleaser.yaml

+33-72
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# documentation at https://goreleaser.com
21
project_name: gloomberg
32

43
# This is an example .goreleaser.yml file with some sensible defaults.
@@ -13,21 +12,10 @@ before:
1312
# - oapi-codegen -package ensmetadata -old-config-style -generate types,client,spec internal/assets/ens_metadata_service_0.0.1-alpha.1.yaml > internal/ensmetadata/ensmetadata.go
1413
builds:
1514
- binary: gloomberg
16-
env:
17-
- CGO_ENABLED=0
18-
flags:
19-
- -trimpath
20-
goos:
21-
- linux
22-
- darwin
23-
- windows
24-
goarch:
25-
- amd64
26-
- arm64
27-
28-
ignore:
29-
- goos: windows
30-
goarch: arm64
15+
env: ["CGO_ENABLED=0"]
16+
flags: ["-trimpath"]
17+
goos: [linux, darwin]
18+
goarch: [amd64, arm64]
3119

3220
# Set the modified timestamp on the output binary, typically
3321
# you would do this to ensure a build was reproducible. Pass
@@ -50,70 +38,43 @@ universal_binaries:
5038
replace: true
5139

5240
dockers:
53-
- image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-amd64", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-amd64"]
54-
use: buildx
55-
dockerfile: .github/run.Dockerfile
56-
build_flag_templates: ["--platform=linux/amd64"]
57-
- image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-arm64v8", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-arm64v8"]
58-
use: buildx
59-
goarch: arm64
60-
dockerfile: .github/run.Dockerfile
61-
build_flag_templates: ["--platform=linux/arm64/v8"]
41+
- image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-amd64", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-amd64"]
42+
use: buildx
43+
dockerfile: .github/run.Dockerfile
44+
build_flag_templates: ["--platform=linux/amd64"]
45+
- image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-arm64v8", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-arm64v8"]
46+
use: buildx
47+
goarch: arm64
48+
dockerfile: .github/run.Dockerfile
49+
build_flag_templates: ["--platform=linux/arm64/v8"]
6250

6351
docker_manifests:
64-
- name_template: "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}"
65-
image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-amd64", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-arm64v8"]
66-
- name_template: "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest"
67-
image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-amd64", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-arm64v8"]
52+
- name_template: "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}"
53+
image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-amd64", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:{{ .Version }}-arm64v8"]
54+
- name_template: "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest"
55+
image_templates: ["{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-amd64", "{{ .Env.REGISTRY }}/benleb/{{ .ProjectName }}:latest-arm64v8"]
56+
57+
kos:
58+
- repository: "ghcr.io/benleb/gloomberg"
59+
bare: true
60+
preserve_import_paths: false
61+
tags: ["{{.Tag}}", latest]
62+
platforms: [linux/amd64, linux/arm64]
6863

69-
# config the checksum filename
70-
# https://goreleaser.com/customization/checksum
71-
checksum:
72-
name_template: "checksums.txt"
64+
# config the checksum filename | https://goreleaser.com/customization/checksum
65+
checksum: { name_template: "checksums.txt" }
7366

74-
snapshot:
75-
# name_template: "{{ incpatch .Version }}-dev"
76-
name_template: "{{ .Summary }}"
67+
snapshot: { name_template: "{{ .Summary }}" }
7768

78-
changelog:
79-
sort: asc
80-
filters:
81-
exclude:
82-
- '^docs:'
83-
- '^test:'
69+
changelog: { sort: asc, filters: { exclude: ["^docs:", "^test:"] } }
8470

8571
announce:
8672
telegram:
87-
# Whether its enabled or not.
88-
# Defaults to false.
89-
enabled: false
73+
# Whether its enabled or not. Defaults to false.
74+
enabled: true
9075

9176
# Integer representation of your channel
92-
chat_id: -575512868
93-
94-
# Message template to use while publishing.
95-
# Defaults to `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}`
96-
message_template: "💸 🚀 🙌 {{ .ProjectName }} {{.Tag}} is out! → {{ .ReleaseURL }} 🙌 🚀 💸"
97-
98-
# gomod:
99-
# # Proxy a module from proxy.golang.org, making the builds verifiable.
100-
# # This will only be effective if running against a tag. Snapshots will ignore this setting.
101-
# # Notice: for this to work your `build.main` must be a package, not a `.go` file.
102-
# #
103-
# # Default is false.
104-
# proxy: true
105-
106-
# # If proxy is true, use these environment variables when running `go mod` commands (namely, `go mod tidy`).
107-
# # Defaults to `os.Environ()`.
108-
# env:
109-
# - GOPROXY=https://proxy.golang.org,direct
110-
# - GOSUMDB=sum.golang.org
111-
# # - GOPRIVATE=example.com/blah
112-
113-
# # Sets the `-mod` flag value.
114-
# # Defaults to empty.
115-
# mod: mod
77+
chat_id: -1001808788625
11678

117-
# # Which Go binary to use.
118-
# # Defaults to `go`.
119-
# gobinary: go1.18
79+
# Message template to use while publishing | `{{ .ProjectName }} {{ .Tag }} is out! Check it out at {{ .ReleaseURL }}`
80+
message_template: '🚀🙌 {{ .ProjectName }} *{{ replace .Tag "." "\\." }}* is out 🙌🚀 → {{ replace .ReleaseURL "." "\\." }}'

.pre-commit-config.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.4.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-yaml
11+
exclude: ^mkdocs\.yml$
12+
# - id: check-added-large-files
13+
# exclude: ^mkdocs\.yml$
14+
15+
- repo: https://github.com/golangci/golangci-lint
16+
rev: v1.50.1
17+
hooks:
18+
- id: golangci-lint
19+
args: ["--no-config", "--fast"]

0 commit comments

Comments
 (0)