Skip to content

Commit

Permalink
feat(initial): release
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-jones committed Nov 21, 2018
0 parents commit ba6791b
Show file tree
Hide file tree
Showing 51 changed files with 7,915 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: 2.1

executors:
primary:
docker:
- image: bradjones/gomake-ci-primary:latest
environment:
CGO_ENABLED: 0

jobs:
git-lint:
executor: primary
steps:
- checkout
- restore_cache:
key: node-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile
- save_cache:
key: node-dependencies-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- run:
name: Lint Git Commit Messages
command: >-
(if [ "$(git rev-list --count master)" -gt "1" ];
then
yarn commitlint --from=master^1 --to="$CIRCLE_SHA1";
else
yarn commitlint --from=master --to="$CIRCLE_SHA1";
fi)
test:
executor: primary
steps:
- checkout
- restore_cache:
key: go-dependencies-{{ checksum "go.sum" }}
- run: go mod download
- save_cache:
key: go-dependencies-{{ checksum "go.sum" }}
paths:
- /go/pkg
- run: go test -cover ./generator -covermode=atomic -coverprofile=coverage.txt
- run: bash <(curl -s https://codecov.io/bash)

release:
executor: primary
steps:
- checkout
- restore_cache:
key: node-dependencies-{{ checksum "yarn.lock" }}
- run: yarn install --frozen-lockfile
- restore_cache:
key: go-dependencies-{{ checksum "go.sum" }}
- run: go mod download
- run: yarn semantic-release

workflows:
version: 2
build:
jobs:
- git-lint
- test
- release:
requires:
- git-lint
- test
40 changes: 40 additions & 0 deletions .circleci/images/primary/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Upstream image sources
FROM docker:18.09.0 as docker
FROM node:11.2.0-alpine AS node
FROM golang:1.11.2-alpine3.8 AS go

FROM alpine:3.8 AS final

# This is used by both the docker and golang install
# see: https://github.com/docker-library/docker/blob/master/18.09/Dockerfile
# see: https://github.com/docker-library/golang/blob/master/1.11/alpine3.8/Dockerfile
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf

# Copy docker
COPY --from=docker /usr/local/. /usr/local/

# Copy golang
COPY --from=go /usr/local/. /usr/local/
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

# Copy node & yarn
COPY --from=node /usr/lib/. /usr/lib/
COPY --from=node /usr/local/. /usr/local/
COPY --from=node /opt/. /opt/

# Install what we can directly from the Alpine packages.
# Mandatory tooling for circleci images is also included.
# see: https://circleci.com/docs/2.0/custom-images/#required-tools-for-primary-containers
RUN apk --no-cache add \
bash \
ca-certificates \
curl \
gcc \
git \
gzip \
make \
openssh-client \
tar \
xz
2 changes: 2 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extends:
- "@commitlint/config-conventional"
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
indent_brace_style = Allman

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[{*.go,*.gotmpl,Makefile}]
indent_style = tab
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
174 changes: 174 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Created by https://www.gitignore.io/api/node,go,linux,macos,windows
# Edit at https://www.gitignore.io/?templates=node,go,linux,macos,windows

### Go ###
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

### Go Patch ###
/vendor/
/Godeps/

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# FuseBox cache
.fusebox/

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/node,go,linux,macos,windows

# Our build artifacts
dist/

# Our test artifacts
*.coverprofile
2 changes: 2 additions & 0 deletions .huskyrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hooks:
commit-msg: commitlint -E HUSKY_GIT_PARAMS
29 changes: 29 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
plugins:

# Determine the type of release by analyzing commits.
# ie: Major, Minor or Patch
- "@semantic-release/commit-analyzer"

# Generate CHANGELOG.md
- "@semantic-release/release-notes-generator"
- "@semantic-release/changelog"

# Build the release artifacts
# This includes tarballs, rpms/debs, docker images, etc
- - "@semantic-release/exec"
- prepareCmd: "make release"

# Commit CHANGELOG.md back to repo
- - "@semantic-release/git"
- assets: [ CHANGELOG.md ]
message: "chore(release): update changelog [skip ci]"

# Create new github release
- - "@semantic-release/github"
- assets:
- path: "./dist/**/*"
- path: "./dist/**/*.*"

# Run final publish tasks, such as docker push
- - "@semantic-release/exec"
- publishCmd: "make publish"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Brad Jones

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit ba6791b

Please sign in to comment.