Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
bskim45 committed Feb 16, 2020
0 parents commit f71ed93
Show file tree
Hide file tree
Showing 55 changed files with 3,268 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
.gitignore
README.md
LICENSE
bin
.idea
.editorconfig
.env
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

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

[*.go]
indent_style = tab

[{*.yml,*.yaml}]
indent_size = 2
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=8be682fe-4731-415d-80aa-2ad8a0acc2c6
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release

on:
push:
tags:
- "*"

jobs:
build:
name: Test and Build
runs-on: ubuntu-latest
env:
VERBOSE: 1
GOFLAGS: -mod=readonly
GOPROXY: https://proxy.golang.org

steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x

- name: Checkout code
uses: actions/checkout@v2

- name: Unshallow
run: git fetch --prune --unshallow

- name: Run tests
run: make test

- name: Run linter
run: make lint

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Login
uses: azure/docker-login@v1
with:
username: bskim45
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build Docker Image
run: make docker-build-image

- name: Tag Docker Image
run: make docker-tag

- name: Publish Docker Image
run: make docker-publish

# - name: Get tag name
# id: tag_name
# uses: olegtarasov/get-tag@v1
#
# - name: Release GitHub
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# name: v${{ steps.tag_name.outputs.tag }}
# draft: false
# prerelease: false
# files: |
# dist/dtags-*.tar.gz
# dist/dtags-*.zip
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test and Build

on:
push:
branches:
- master
pull_request:

jobs:
build:
name: Test and Build
strategy:
matrix:
go: ['1.12', '1.13']
runs-on: ubuntu-latest
env:
VERBOSE: 1
GOFLAGS: -mod=readonly
GOPROXY: https://proxy.golang.org

steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Setup env
shell: bash
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
- name: Checkout code
uses: actions/checkout@v2

- name: Cache modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: make test

- name: Run linter
run: make lint

- name: Cross Build
run: |
go get github.com/mitchellh/gox
make cross-build
- name: Store artifact
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
### vscode
/.vscode/*
!/.vscode/launch.json
!/.vscode/tasks.json

### idea
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Editor-based Rest Client
.idea/httpRequests


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

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

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

# Dependency directories (remove the comment below to include it)
vendor/

bin/
dist/
54 changes: 54 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
project_name: dtags

builds:
- env:
- CGO_ENABLED=0
goos:
- freebsd
- windows
- darwin
- linux
goarch:
- amd64
- arm
- arm64
- 386
ldflags:
- -s -w

archives:
- replacements:
386: i386
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Version }}-SNAPSHOT-{{.ShortCommit}}"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^bump'

release:
github:
owner: bskim45
name: dtags

name_template: "{{.ProjectName}} v{{.Version}}"

brews:
-
github:
owner: bskim45
name: homebrew-dtags

homepage: 'https://github.com/bskim45/dtags/'

description: ''
13 changes: 13 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/dtags.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/go.imports.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM gcr.io/distroless/static:nonroot
LABEL maintainer="[email protected]"

ARG VCS_REF
ARG BUILD_DATE
ARG VERSION

LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.name="dtags" \
org.label-schema.url="https://hub.docker.com/r/bskim45/dtags/" \
org.label-schema.vcs-url="https://github.com/bskim45/dtags" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.version=$VERSION

COPY dist/dtags_linux_amd64/dtags /go/bin/dtags

ENTRYPOINT ["/go/bin/dtags"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Bumsoo Kim

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 f71ed93

Please sign in to comment.