Skip to content

Commit c4d1c75

Browse files
feat: initial commit
0 parents  commit c4d1c75

Some content is hidden

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

65 files changed

+5794
-0
lines changed

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

.github/FUNDING.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These are supported funding model platforms
2+
3+
patreon: jandedobbeleer
4+
liberapay: jandedobbeleer
5+
custom: https://ko-fi.com/jandedobbeleer

.github/workflows/code.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- 'README.md'
5+
- 'docs/**'
6+
7+
name: Validate Code
8+
jobs:
9+
test:
10+
env:
11+
GOPATH: ${{ github.workspace }}
12+
GO111MODULE: off
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
include:
17+
- os: ubuntu-latest
18+
INSTALL_DEP: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
19+
- os: macos-latest
20+
INSTALL_DEP: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
21+
- os: windows-latest
22+
INSTALL_DEP: choco install dep
23+
defaults:
24+
run:
25+
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
26+
runs-on: ${{ matrix.os }}
27+
steps:
28+
- name: Install Go
29+
uses: actions/setup-go@v2
30+
with:
31+
go-version: 1.15.x
32+
- name: Checkout code
33+
uses: actions/checkout@v2
34+
with:
35+
path: ./src/github.com/${{ github.repository }}
36+
- name: Install dependencies
37+
run: |
38+
${{ matrix.INSTALL_DEP }}
39+
dep ensure -v
40+
- name: Install dependencies
41+
run: dep ensure -v
42+
- name: Golang CI
43+
if: matrix.os == 'ubuntu-latest'
44+
uses: golangci/golangci-lint-action@v2
45+
with:
46+
version: v1.31
47+
working-directory: ./src/github.com/${{ github.repository }}
48+
- name: Unit Tests
49+
run: go test . -v

.github/workflows/commits.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Validate Commits
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
commitlint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
fetch-depth: 0
12+
- uses: wagoid/commitlint-github-action@v2

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'README.md'
9+
- 'docs/**'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
upload_url: ${{ steps.create_release.outputs.upload_url }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
- name: Get next version
20+
id: version
21+
run: |
22+
curl -L https://github.com/idc101/git-mkver/releases/download/v$MKVER/git-mkver-darwin-amd64-$MKVER.tar.gz | tar xvz
23+
sudo mv git-mkver /usr/local/bin
24+
echo "::set-output name=version::$(git mkver next)"
25+
env:
26+
MKVER: "1.1.1"
27+
- name: Create changelog
28+
id: changelog
29+
uses: TriPSs/conventional-changelog-action@v3
30+
with:
31+
github-token: ${{ secrets.github_token }}
32+
skip-version-file: "true"
33+
output-file: "false"
34+
skip-commit: "true"
35+
fallback-version: ${{ steps.version.outputs.version }}
36+
- name: Create Github Release
37+
id: create_release
38+
uses: actions/create-release@v1
39+
if: ${{ steps.changelog.outputs.skipped == 'false' }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.github_token }}
42+
with:
43+
tag_name: ${{ steps.changelog.outputs.tag }}
44+
release_name: ${{ steps.changelog.outputs.tag }}
45+
body: ${{ steps.changelog.outputs.clean_changelog }}
46+
artifacts:
47+
needs: release
48+
env:
49+
GOPATH: ${{ github.workspace }}
50+
GO111MODULE: off
51+
strategy:
52+
matrix:
53+
os: [ubuntu-latest, macos-latest, windows-latest]
54+
include:
55+
- os: ubuntu-latest
56+
ARTIFACT: posh-linux-amd64
57+
INSTALL_DEP: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
58+
- os: macos-latest
59+
ARTIFACT: posh-darwin-amd64
60+
INSTALL_DEP: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
61+
- os: windows-latest
62+
ARTIFACT: posh-windows-amd64.exe
63+
INSTALL_DEP: choco install dep
64+
defaults:
65+
run:
66+
working-directory: ${{ github.workspace }}/src/github.com/${{ github.repository }}
67+
runs-on: ${{ matrix.os }}
68+
steps:
69+
- name: Install Go
70+
uses: actions/setup-go@v2
71+
with:
72+
go-version: 1.15.x
73+
- name: Checkout code
74+
uses: actions/checkout@v2
75+
with:
76+
path: ./src/github.com/${{ github.repository }}
77+
- name: Install dependencies
78+
run: |
79+
${{ matrix.INSTALL_DEP }}
80+
dep ensure -v
81+
- name: Build
82+
id: build
83+
run: go build -o ${{ matrix.ARTIFACT }}
84+
env:
85+
GOARCH: "amd64"
86+
- name: Upload Release Asset
87+
id: upload-release-asset
88+
uses: actions/upload-release-asset@v1
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
with:
92+
upload_url: ${{ needs.release.outputs.upload_url }}
93+
asset_path: ./src/github.com/${{ github.repository }}/${{ matrix.ARTIFACT }}
94+
asset_name: ${{ matrix.ARTIFACT }}
95+
asset_content_type: application/octet-stream

.gitignore

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/node,go,visualstudiocode
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=node,go,visualstudiocode
4+
5+
### Go ###
6+
# Binaries for programs and plugins
7+
*.exe
8+
*.exe~
9+
*.dll
10+
*.so
11+
*.dylib
12+
13+
# Test binary, built with `go test -c`
14+
*.test
15+
16+
# Output of the go coverage tool, specifically when used with LiteIDE
17+
*.out
18+
19+
# Dependency directories (remove the comment below to include it)
20+
# vendor/
21+
22+
### Go Patch ###
23+
/vendor/
24+
/Godeps/
25+
26+
### Node ###
27+
# Logs
28+
logs
29+
*.log
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
lerna-debug.log*
34+
35+
# Diagnostic reports (https://nodejs.org/api/report.html)
36+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
37+
38+
# Runtime data
39+
pids
40+
*.pid
41+
*.seed
42+
*.pid.lock
43+
44+
# Directory for instrumented libs generated by jscoverage/JSCover
45+
lib-cov
46+
47+
# Coverage directory used by tools like istanbul
48+
coverage
49+
*.lcov
50+
51+
# nyc test coverage
52+
.nyc_output
53+
54+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
55+
.grunt
56+
57+
# Bower dependency directory (https://bower.io/)
58+
bower_components
59+
60+
# node-waf configuration
61+
.lock-wscript
62+
63+
# Compiled binary addons (https://nodejs.org/api/addons.html)
64+
build/Release
65+
66+
# Dependency directories
67+
node_modules/
68+
jspm_packages/
69+
70+
# TypeScript v1 declaration files
71+
typings/
72+
73+
# TypeScript cache
74+
*.tsbuildinfo
75+
76+
# Optional npm cache directory
77+
.npm
78+
79+
# Optional eslint cache
80+
.eslintcache
81+
82+
# Microbundle cache
83+
.rpt2_cache/
84+
.rts2_cache_cjs/
85+
.rts2_cache_es/
86+
.rts2_cache_umd/
87+
88+
# Optional REPL history
89+
.node_repl_history
90+
91+
# Output of 'npm pack'
92+
*.tgz
93+
94+
# Yarn Integrity file
95+
.yarn-integrity
96+
97+
# dotenv environment variables file
98+
.env
99+
.env.test
100+
101+
# parcel-bundler cache (https://parceljs.org/)
102+
.cache
103+
104+
# Next.js build output
105+
.next
106+
107+
# Nuxt.js build / generate output
108+
.nuxt
109+
dist
110+
111+
# Gatsby files
112+
.cache/
113+
# Comment in the public line in if your project uses Gatsby and not Next.js
114+
# https://nextjs.org/blog/next-9-1#public-directory-support
115+
# public
116+
117+
# vuepress build output
118+
.vuepress/dist
119+
120+
# Serverless directories
121+
.serverless/
122+
123+
# FuseBox cache
124+
.fusebox/
125+
126+
# DynamoDB Local files
127+
.dynamodb/
128+
129+
# TernJS port file
130+
.tern-port
131+
132+
# Stores VSCode versions used for testing VSCode extensions
133+
.vscode-test
134+
135+
### VisualStudioCode ###
136+
.vscode/*
137+
!.vscode/settings.json
138+
!.vscode/tasks.json
139+
!.vscode/launch.json
140+
!.vscode/extensions.json
141+
*.code-workspace
142+
143+
### VisualStudioCode Patch ###
144+
# Ignore all local history of files
145+
.history
146+
147+
# End of https://www.toptal.com/developers/gitignore/api/node,go,visualstudiocode

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "auto",
12+
"program": "${workspaceFolder}/main.go",
13+
"cwd": "${workspaceFolder}",
14+
"env": {},
15+
"args": []
16+
}
17+
]
18+
}

0 commit comments

Comments
 (0)