Skip to content

Commit

Permalink
Initial import project
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen committed Dec 5, 2020
0 parents commit 6c04dc0
Show file tree
Hide file tree
Showing 13 changed files with 637 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
pull-request-branch-name:
separator: "-"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
pull-request-branch-name:
separator: "-"
36 changes: 36 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
name-template: 'v$NEXT_PATCH_VERSION 🌈'
tag-template: 'v$NEXT_PATCH_VERSION'
version-template: $MAJOR.$MINOR.$PATCH
# Emoji reference: https://gitmoji.carloscuesta.me/
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'regression'
- title: 📝 Documentation updates
label: documentation
- title: 👻 Maintenance
labels:
- chore
- dependencies
- title: 🚦 Tests
labels:
- test
- tests
exclude-labels:
- reverted
- no-changelog
- skip-changelog
- invalid
change-template: '* $TITLE (#$NUMBER) @$AUTHOR'
template: |
## What’s Changed
$CHANGES
62 changes: 62 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
repository:
name: cgit
description: cgit is a tiny tool for Chinese developers.
homepage: https://github.com/linuxsuren
private: false
has_issues: true
has_wiki: false
has_downloads: false
default_branch: master
allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: true
labels:
- name: newbie
color: abe7f4
description: 新手上路
- name: bug
color: d73a4a
description: Something isn't working
- name: feature
color: ffc6a3
- name: enhancement
color: a2eeef
description: New feature or request
- name: help wanted
color: 008672
description: Extra attention is needed
- name: bugfix
color: 0412d6
- name: regression
color: c5def5
- name: documentation
color: 5ce05e
- name: Hacktoberfest
description: More details from https://hacktoberfest.digitalocean.com/
color: 5ce05e
- name: test
color: c2c2fc
- name: chore
color: c2c2fc
- name: dependencies
color: 0366d6
description: Pull requests that update a dependency file
- name: no-changelog
color: c2c2fc
branches:
- name: master
protection:
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
require_code_owner_reviews: true
dismissal_restrictions:
users: []
teams: []
required_status_checks:
strict: true
contexts: []
enforce_admins: false
restrictions:
users: []
teams: []
18 changes: 18 additions & 0 deletions .github/workflows/backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Backup Git repository

on:
workflow_dispatch:
push:
branches:
- master

jobs:
BackupGit:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: backup
uses: jenkins-zh/[email protected]
env:
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
TARGET_GIT: "[email protected]:linuxsuren/cgit.git"
42 changes: 42 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Pull Request Build

on:
pull_request:
branches:
- master

jobs:
build:
name: Build
runs-on: macos-10.15
steps:
- name: Set up Go 1.13
uses: actions/[email protected]
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/[email protected]
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
version: latest
args: check
- name: Build
run: |
go build
GoLint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/[email protected]
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/[email protected]
- name: Go-linter-1
uses: Jerome1337/[email protected]
with:
golint-path: ./...
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- '*'

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.13.x
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_SECRETS }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
88 changes: 88 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Official documentation at http://goreleaser.com
project_name: cgit
builds:
- env:
- CGO_ENABLED=0
binary: cgit
goarch:
- amd64
- arm64
goos:
- windows
- linux
- darwin
hooks:
post:
- upx "{{ .Path }}"
ldflags:
- -X github.com/linuxsuren/cgit/app.version={{.Version}}
- -X github.com/linuxsuren/cgit/app.commit={{.ShortCommit}}
- -X github.com/linuxsuren/cgit/app.date={{.Date}}
- -w
dist: release
archives:
- name_template: "{{ .Binary }}-{{ .Os }}-{{ .Arch }}"
replacements:
darwin: darwin
linux: linux
windows: windows
amd64: amd64
arm64: arm64
format_overrides:
- goos: windows
format: zip
files:
- README.md
- README-zh.md
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next-{{.ShortCommit}}"
changelog:
skip: true
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
brews:
-
name: cgit
tap:
owner: linuxsuren
name: homebrew-cgit
folder: Formula
homepage: "https://github.com/linuxsuren/cgit"
description: cgit is a tiny tool for Chinese developers.
dependencies:
- name: vim
type: optional
- name: bash-completion
type: optional
test: |
version_output = shell_output("#{bin}/cgit version")
assert_match version.to_s, version_output
install: |
bin.install name
prefix.install_metafiles
nfpms:
- file_name_template: "{{ .Binary }}-{{.Os}}-{{.Arch}}"
homepage: https://github.com/linuxsuren/cgit
description: cgit is a tiny tool for Chinese developers.
maintainer: rick <[email protected]>
license: MIT
vendor: Jenkins
formats:
- deb
- rpm
recommends:
- bash-completion
- vim
bindir: /usr/bin
replacements:
amd64: 64bit
arm64: arm64
darwin: macOS
linux: linux
windows: windows
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cgit is a tiny tool for Chinese developers.
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/linuxsuren/cgit

go 1.15

require (
github.com/magiconair/properties v1.8.1
github.com/spf13/cobra v1.1.1
)
Loading

0 comments on commit 6c04dc0

Please sign in to comment.