Skip to content

Commit a30b08c

Browse files
committed
initial changes
1 parent 416a69d commit a30b08c

File tree

10 files changed

+22
-126
lines changed

10 files changed

+22
-126
lines changed

.github/Brewfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
tap "golangci/tap"
2-
tap "vektra/tap"
3-
tap "kyoh86/tap"
42
tap "sv-tools/apps"
53
tap "goreleaser/tap"
64

75
# Fast linters runner for Go.
86
brew "golangci/tap/golangci-lint"
97
# Rich-Go will enrich `go test` outputs with text decorations
108
brew "kyoh86/tap/richgo"
11-
# bumptag is a tool to increment a version and to create a git tag with an annotation.
12-
brew "sv-tools/apps/bumptag"
13-
# A mock code autogenerator for Go
14-
brew "vektra/tap/mockery"
159
# Deliver Go binaries as fast and easily as possible
1610
brew "goreleaser/tap/goreleaser"

.github/Dockerfile

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

.github/goreleaser-cli.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project_name: go-repo-template
1+
project_name: mock-http-server
22

33
release:
44
prerelease: auto
@@ -27,12 +27,9 @@ archives:
2727
checksum:
2828
name_template: "{{ .ProjectName }}-{{ .Tag }}-checksums.txt"
2929

30-
signs:
31-
- artifacts: checksum
32-
3330
dockers:
3431
- image_templates: ["ghcr.io/sv-tools/{{ .ProjectName }}:{{ .Tag }}-amd64"]
35-
dockerfile: .github/Dockerfile
32+
dockerfile: Dockerfile
3633
use: buildx
3734
goarch: amd64
3835
build_flag_templates:
@@ -46,7 +43,7 @@ dockers:
4643
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
4744
- "--label=org.opencontainers.image.licenses=MIT"
4845
- image_templates: ["ghcr.io/sv-tools/{{ .ProjectName }}:{{ .Tag }}-arm64v8"]
49-
dockerfile: .github/Dockerfile
46+
dockerfile: Dockerfile
5047
use: buildx
5148
goarch: arm64
5249
build_flag_templates:
@@ -60,7 +57,7 @@ dockers:
6057
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
6158
- "--label=org.opencontainers.image.licenses=MIT"
6259
- image_templates: ["svtools/{{ .ProjectName }}:{{ .Tag }}-amd64"]
63-
dockerfile: .github/Dockerfile
60+
dockerfile: Dockerfile
6461
use: buildx
6562
goarch: amd64
6663
build_flag_templates:
@@ -74,7 +71,7 @@ dockers:
7471
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
7572
- "--label=org.opencontainers.image.licenses=MIT"
7673
- image_templates: ["svtools/{{ .ProjectName }}:{{ .Tag }}-arm64v8"]
77-
dockerfile: .github/Dockerfile
74+
dockerfile: Dockerfile
7875
use: buildx
7976
goarch: arm64
8077
build_flag_templates:

.github/goreleaser-lib.yml

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

.github/workflows/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
env:
18-
GO: "1.17"
18+
GO: "1.20"
1919

2020
jobs:
2121
CodeQL:

.github/workflows/release.yaml

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: "New Release"
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
version:
7-
description: "Tag name in semver format. Example: v0.0.1"
8-
required: true
94
push:
105
tags:
116
- "v[0-9]+.[0-9]+.[0-9]+"
@@ -14,31 +9,9 @@ permissions:
149
contents: write
1510

1611
env:
17-
GO: "1.17"
12+
GO: "1.20"
1813

1914
jobs:
20-
bump-version:
21-
if: github.event_name == 'workflow_dispatch'
22-
runs-on: ubuntu-latest
23-
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v3
26-
with:
27-
fetch-depth: 0
28-
29-
- name: Configure Git
30-
run: |
31-
git config user.name "sv-tools-bot"
32-
git config user.email "[email protected]"
33-
git fetch --all
34-
35-
- name: Create Tag
36-
run: |
37-
docker run --rm -v $PWD:/mount -w /mount svtools/bumptag:latest ${{ github.event.inputs.version }}
38-
39-
- name: Push Tag
40-
run: git push origin --tags
41-
4215
release-cli:
4316
if: github.event_name == 'push'
4417
runs-on: ubuntu-latest
@@ -53,13 +26,6 @@ jobs:
5326
with:
5427
go-version: ${{ env.GO }}
5528

56-
- name: Prepare gpg
57-
run: |
58-
gpgconf --kill gpg-agent
59-
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.GPG_PASSPHRASE }}" --output .github/sv-tools-bot.asc .github/sv-tools-bot.asc.gpg
60-
gpg --batch --yes --import .github/sv-tools-bot.asc
61-
rm .github/sv-tools-bot.asc
62-
6329
- name: Allow arm Docker builds # https://github.com/linuxkit/linuxkit/tree/master/pkg/binfmt
6430
run: sudo docker run --privileged linuxkit/binfmt:v0.8
6531

@@ -87,23 +53,3 @@ jobs:
8753
- name: Clear
8854
if: always()
8955
run: rm -f ${HOME}/.docker/config.json
90-
91-
release-lib:
92-
if: github.event_name == 'push'
93-
runs-on: ubuntu-latest
94-
steps:
95-
- name: Checkout code
96-
uses: actions/checkout@v3
97-
98-
- name: Install Go
99-
uses: actions/setup-go@v3
100-
with:
101-
go-version: ${{ env.GO }}
102-
103-
- name: Run GoReleaser
104-
uses: goreleaser/goreleaser-action@v3
105-
with:
106-
version: latest
107-
args: release --rm-dist --config .github/goreleaser-lib.yml
108-
env:
109-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.golangci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@ linters:
1010
- exhaustive
1111
- exportloopref
1212
- gci
13-
- gocognit
1413
- goconst
1514
- gocritic
16-
- gocyclo
1715
- goerr113
1816
- gofumpt
1917
- goprintffuncname
2018
- gosec
21-
- ifshort
2219
- lll
2320
- misspell
2421
- nestif
@@ -44,7 +41,7 @@ linters-settings:
4441
disable:
4542
- shadow
4643
gci:
47-
local-prefixes: github.com/sv-tools/go-repo-template
44+
local-prefixes: github.com/sv-tools/mock-http-server
4845
gocognit:
4946
min-complexity: 15
5047
gocyclo:

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM scratch
2+
ENV CONFIG=config.yaml
3+
ENTRYPOINT ["/mock-http-server"]
4+
COPY mock-http-server /

README.md

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,13 @@
1-
# go-repo-template
1+
# mock-http-server
22

3-
[![Code Analysis](https://github.com/sv-tools/go-repo-template/actions/workflows/checks.yaml/badge.svg)](https://github.com/sv-tools/go-repo-template/actions/workflows/checks.yaml)
4-
[![Go Reference](https://pkg.go.dev/badge/github.com/sv-tools/go-repo-template.svg)](https://pkg.go.dev/github.com/sv-tools/go-repo-template)
5-
[![codecov](https://codecov.io/gh/sv-tools/go-repo-template/branch/main/graph/badge.svg?token=0XVOTDR1CW)](https://codecov.io/gh/sv-tools/go-repo-template)
6-
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/sv-tools/go-repo-template?style=flat)](https://github.com/sv-tools/go-repo-template/releases)
7-
8-
The template for new go repositories
9-
10-
## Features
11-
12-
1. `Makefile` to run some basic validations:
13-
1. `golangci-lint`
14-
2. `nancy`
15-
3. unit and benchmarks tests
16-
4. installing all needed tools on macOS using `brew`
17-
5. cleaning up the `go.sum` file by removing it and re-creating by `go mod tidy`
18-
2. MIT License by default
19-
3. GitHub Action workflows:
20-
1. testing all pull requests by running same tools and checking code coverage using `codecov` action
21-
2. making a new release, triggered by closed milestone
22-
1. creates a new tag using `bumptag` tool
23-
2. creates new `Next` milestone
24-
3. runs `goreleaser` to build a new release
25-
26-
## Usage
27-
28-
1. Create a repository using this repo as template
29-
2. Replace in all files `go-repo-template` to the project's name
30-
3. In case of:
31-
1. library
32-
1. Remove `.github/Dockerfile`, `.github/goreleaser-cli.yml` files
33-
2. Remove `release-cli` section in the `.github/workflows/release.yaml` file
34-
2. command line tool (cli)
35-
1. Remove `.github/goreleaser-lib.yml` file
36-
2. Remove `release-lib` section in the `.github/workflows/release.yaml` file
37-
4. Modify `README.md` by removing this text
38-
5. Feel free to modify any other files
3+
[![Code Analysis](https://github.com/sv-tools/mock-http-server/actions/workflows/checks.yaml/badge.svg)](https://github.com/sv-tools/mock-http-server/actions/workflows/checks.yaml)
4+
[![Go Reference](https://pkg.go.dev/badge/github.com/sv-tools/mock-http-server.svg)](https://pkg.go.dev/github.com/sv-tools/mock-http-server)
5+
[![codecov](https://codecov.io/gh/sv-tools/mock-http-server/branch/main/graph/badge.svg?token=0XVOTDR1CW)](https://codecov.io/gh/sv-tools/mock-http-server)
6+
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/sv-tools/mock-http-server?style=flat)](https://github.com/sv-tools/mock-http-server/releases)
397

8+
A simple HTTP Server to be used for the unit or end-to-end to integrations tests.
9+
* yaml based configuration
10+
* docker image
4011

4112
## License
4213

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/sv-tools/go-repo-template
1+
module github.com/sv-tools/mock-http-server
22

3-
go 1.17
3+
go 1.20

0 commit comments

Comments
 (0)