Skip to content

Commit c022027

Browse files
authored
feat!: v2 rewrite in golang (#24)
closes #17 BREAKING CHANGE: initial rewrite of bgps in Golang
1 parent aebdb9c commit c022027

File tree

1,039 files changed

+26909
-84
lines changed

Some content is hidden

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

1,039 files changed

+26909
-84
lines changed

.fdignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
testdata

.github/workflows/release.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/test_release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: test_release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-22.04
17+
name: test
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version-file: go.mod
28+
cache: true
29+
30+
- name: golangci-lint
31+
uses: golangci/golangci-lint-action@v4
32+
with:
33+
version: latest
34+
35+
- name: test
36+
run: |
37+
make test
38+
39+
40+
release:
41+
if: (github.ref == 'refs/heads/main') && (github.repository_owner == 'mikesmithgh')
42+
runs-on: ubuntu-22.04
43+
name: release
44+
needs:
45+
- test
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
52+
- name: Setup Go
53+
uses: actions/setup-go@v5
54+
with:
55+
go-version-file: go.mod
56+
cache: true
57+
58+
- name: Setup Node
59+
uses: actions/setup-node@v3
60+
with:
61+
node-version: lts/*
62+
63+
- name: Setup GoReleaser
64+
uses: goreleaser/goreleaser-action@v5
65+
with:
66+
distribution: goreleaser
67+
version: latest
68+
install-only: true
69+
70+
- name: Semantic Release
71+
run: |
72+
npm install @semantic-release/git @semantic-release/changelog @semantic-release/exec -D
73+
npx semantic-release
74+
env:
75+
GH_TOKEN: ${{ secrets.BGPS_CI_TOKEN }}
76+
GITHUB_TOKEN: ${{ secrets.BGPS_CI_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
*.swp
2+
tmp/
3+
dist/
4+
node_modules/
5+
package-lock.json
6+
package.json

.golangci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
linters:
2+
enable:
3+
- errcheck
4+
- gosimple
5+
- govet
6+
- ineffassign
7+
- staticcheck
8+
- unused
9+
- errorlint
10+
- gofmt
11+
- goimports
12+
- gosec
13+
- whitespace
14+
- bodyclose
15+
- dogsled
16+
- durationcheck
17+
- errorlint
18+
- exhaustive
19+
- exportloopref
20+
- goconst
21+
- gocritic
22+
- gosec
23+
- importas
24+
- misspell
25+
- nilerr
26+
- gofumpt
27+
28+
linters-settings:
29+
gosec:
30+
excludes:
31+
- G204

.goreleaser.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 1
2+
3+
builds:
4+
- env:
5+
- CGO_ENABLED=0
6+
goos:
7+
- linux
8+
- windows
9+
- darwin
10+
11+
archives:
12+
- format: tar.gz
13+
# this name template makes the OS and Arch compatible with the results of `uname`.
14+
name_template: >-
15+
{{ .ProjectName }}_
16+
{{- title .Os }}_
17+
{{- if eq .Arch "amd64" }}x86_64
18+
{{- else if eq .Arch "386" }}i386
19+
{{- else }}{{ .Arch }}{{ end }}
20+
{{- if .Arm }}v{{ .Arm }}{{ end }}
21+
# use zip for windows archives
22+
format_overrides:
23+
- goos: windows
24+
format: zip
25+
26+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
27+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

.releaserc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
}
2020
],
2121
[
22-
"@semantic-release/github"
22+
"@semantic-release/exec",
23+
{
24+
"publishCmd": "./scripts/release_publish.sh \"${nextRelease.notes}\""
25+
}
2326
]
2427
]
2528
}
26-

.rgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
testdata

Dockerfile

Lines changed: 0 additions & 23 deletions
This file was deleted.

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.PHONY: help
2+
help:
3+
@echo "==> describe make commands"
4+
@echo ""
5+
@echo "build ==> build bgps for current GOOS and GOARCH"
6+
@echo "test ==> run tests"
7+
8+
.PHONY: build
9+
build:
10+
@goreleaser build --single-target --clean --snapshot
11+
12+
.PHONY: test
13+
test:
14+
# TODO: temporary hack return 0 for first release
15+
@echo skipping tests
16+

0 commit comments

Comments
 (0)