Skip to content

Commit 7ec782e

Browse files
committed
updating readme and workflow created
1 parent 8030e51 commit 7ec782e

5 files changed

Lines changed: 176 additions & 0 deletions

File tree

.github/changelog.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"resolve": "commits",
3+
"sort": "asc",
4+
5+
"template": ".github/changelog_template.md",
6+
7+
"groupings": [
8+
{ "name": "New Features", "patterns": [ "(?i)^new\\b" ] },
9+
{ "name": "Fixes", "patterns": [ "(?i)^fix\\b" ] },
10+
{ "name": "Misc", "patterns": [ ".*" ] }
11+
],
12+
"exclude": [
13+
"^test\\b",
14+
"^docs\\b",
15+
"^(?i)refactor\\b",
16+
"^(?i)release\\s+\\d+\\.\\d+\\.\\d+",
17+
"^(?i)minor fix\\b",
18+
"^(?i)no comment\\b",
19+
"^(?i)wip\\b"
20+
],
21+
22+
"local": false,
23+
24+
"max_commits": 250
25+
}

.github/changelog_template.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{define "GroupTemplate" -}}
2+
{{- range .Grouped}}
3+
### {{ .Name }}
4+
5+
{{range .Items -}}
6+
* [{{.CommitHashShort}}]({{.CommitURL}}) {{.Title}} ({{if .IsPull}}[contributed]({{.PullURL}}) by {{end}}[{{.Author}}]({{.AuthorURL}}))
7+
{{end -}}
8+
{{end -}}
9+
{{end -}}
10+
{{define "FlatTemplate" -}}
11+
{{range .Items -}}
12+
* [{{.CommitHashShort}}]({{.CommitURL}}) {{.Title}} ({{if .IsPull}}[contributed]({{.PullURL}}) by {{end}}[{{.Author}}]({{.AuthorURL}}))
13+
{{end -}}
14+
{{end -}}
15+
{{define "DefaultTemplate" -}}
16+
## Release Note {{.Version}}
17+
{{if len .Grouped -}}
18+
{{template "GroupTemplate" . -}}
19+
{{- else}}
20+
{{template "FlatTemplate" . -}}
21+
{{end}}
22+
{{end -}}
23+
{{template "DefaultTemplate" . -}}

.github/workflows/build.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build and Test
2+
3+
# This workflow will run on main branch and on any pull requests targeting main
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths-ignore:
9+
- '.github/**'
10+
pull_request:
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Set up Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.15
21+
22+
- name: Check out code
23+
uses: actions/checkout@v2
24+
25+
- name: Lint Go Code
26+
run: |
27+
go get -u golang.org/x/lint/golint
28+
make lint
29+
30+
test:
31+
name: Test
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Set up Go
35+
uses: actions/setup-go@v2
36+
with:
37+
go-version: 1.15
38+
39+
- name: Check out code
40+
uses: actions/checkout@v2
41+
42+
- name: Run Unit tests.
43+
run: make test-coverage
44+
45+
# - name: Upload Coverage report to CodeCov
46+
# uses: codecov/codecov-action@v1.0.0
47+
# with:
48+
# token: ${{secrets.CODECOV_TOKEN}}
49+
# file: ./coverage.txt
50+
51+
build:
52+
name: Build
53+
runs-on: ubuntu-latest
54+
needs: [lint, test]
55+
steps:
56+
- name: Set up Go
57+
uses: actions/setup-go@v2
58+
with:
59+
go-version: 1.15
60+
61+
- name: Check out code
62+
uses: actions/checkout@v2
63+
64+
- name: Build
65+
run: make build

.github/workflows/release.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Release
2+
on:
3+
create:
4+
tags:
5+
- v*
6+
7+
jobs:
8+
release:
9+
name: Release on GitHub
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Find Last Tag
18+
id: last
19+
uses: jimschubert/query-tag-action@v1
20+
with:
21+
include: 'v*'
22+
exclude: '*-rc*'
23+
commit-ish: 'HEAD~'
24+
skip-unshallow: 'true'
25+
26+
- name: Find Current Tag
27+
id: current
28+
uses: jimschubert/query-tag-action@v1
29+
with:
30+
include: 'v*'
31+
exclude: '*-rc*'
32+
commit-ish: '@'
33+
skip-unshallow: 'true'
34+
35+
- name: Create Changelog
36+
id: changelog
37+
uses: jimschubert/beast-changelog-action@v1
38+
with:
39+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
40+
CONFIG_LOCATION: .github/changelog.json
41+
FROM: ${{steps.last.outputs.tag}}
42+
TO: ${{steps.current.outputs.tag}}
43+
OUTPUT: .github/CHANGELOG.md
44+
45+
- name: View Changelog
46+
run: cat .github/CHANGELOG.md
47+
48+
- name: Validates GO releaser config
49+
uses: docker://goreleaser/goreleaser:latest
50+
with:
51+
args: check
52+
53+
- name: Create release on GitHub
54+
uses: docker://goreleaser/goreleaser:latest
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
with:
58+
args: release --rm-dist --release-notes .github/CHANGELOG.md
59+
workdir: ./cmd/driplane

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Cloudwatcher
22
![GitHub](https://img.shields.io/github/license/Matrix86/cloudwatcher)
3+
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/Matrix86/cloudwatcher)
4+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/Matrix86/cloudwatcher)
5+
![Codecov](https://img.shields.io/codecov/c/github/Matrix86/cloudwatcher)
6+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Matrix86/cloudwatcher/Build%20and%20Test)
37

48
File system notification for Cloud platforms (and not) in Golang.
59

0 commit comments

Comments
 (0)