Skip to content

Commit

Permalink
Merge pull request #1 from renlulu/feat/cicd-and-cli
Browse files Browse the repository at this point in the history
feat: cicd and cli
  • Loading branch information
renlulu authored Jun 26, 2024
2 parents c922e53 + a2150b0 commit fe1dbbe
Show file tree
Hide file tree
Showing 15 changed files with 825 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Top-most EditorConfig file
root = true

# Unix-style line endings
[*]
end_of_line = lf
trim_trailing_whitespace = true

# Indentation settings
[*.{sh,yaml,json}]
indent_style = space
indent_size = 2

# Trim trailing whitespace
[{makefile,Makefile,go}]
indent_style = tab
207 changes: 207 additions & 0 deletions .github/changelog-builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": [
"feature",
"feat"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(feat|feature)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(feat|feature): .+",
"flags": "igu"
}
]
},
{
"title": "## 🐛 Fixes",
"labels": [
"fix",
"bug",
"bugfix"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(fix|bug|bugfix)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(fix|bug|bugfix): .+",
"flags": "igu"
}
]
},
{
"title": "## 🧪 CI",
"labels": [
"test",
"ci",
"build"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(test|ci|build)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(test|ci|build): .+",
"flags": "igu"
}
]
},
{
"title": "## 💬 Miscellaneous",
"labels": [
"other",
"chore",
"misc"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(other|chore|misc)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(other|chore|misc): .+",
"flags": "igu"
}
]
},
{
"title": "## 📦 Dependencies",
"labels": [
"dependencies",
"deps",
"dep"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(deps|dep|dependencies)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(deps|dep|dependencies): .+",
"flags": "igu"
}
]
},
{
"title": "## 📝 Documentation",
"labels": [
"docs",
"documentation"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(docs|documentation)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(docs|documentation): .+",
"flags": "igu"
}
]
},
{
"title": "## 🔧 Refactoring",
"labels": [
"refactor",
"refactory",
"refactoring"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(refactor|refactory|refactoring)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(refactor|refactory|refactoring): .+",
"flags": "igu"
}
]
},
{
"title": "## 🧹 Cleanup",
"labels": [
"cleanup",
"clean"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(cleanup|clean)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(cleanup|clean): .+",
"flags": "igu"
}
]
},
{
"title": "## 🚨 Breaking Changes",
"labels": [
"breaking",
"breaking-change",
"breaking-changes",
"breaking change",
"breaking changes"
],
"rules": [
{
"on_property": "branch",
"pattern": "^(breaking|breaking-change|breaking-changes|breaking change|breaking changes)/.+",
"flags": "igu"
},
{
"on_property": "title",
"pattern": "^(breaking|breaking-change|breaking-changes|breaking change|breaking changes): .+",
"flags": "igu"
}
]
}
],
"label_extractor": [
{
"pattern": "(.+) (.+)",
"on_property": "title",
"target": "$1",
"flags": "gu"
},
{
"pattern": "(.+)\\/(.+)",
"target": "$1",
"flags": "igu",
"on_property": "branch",
"method": "match"
}
],
"ignore_labels": [
"ignore"
],
"sort": "ASC",
"template": "${{RELEASE_DIFF}}\n${{CHANGELOG}}",
"pr_template": "- ${{TITLE}} (#${{NUMBER}}) @${{AUTHOR}}",
"empty_template": "- no changes",
"max_pull_requests": 1000,
"max_back_track_time_days": 1000
}
73 changes: 73 additions & 0 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# https://github.com/srvaroa/labeler
version: 1
issues: true
labels:
- label: "XS"
size: { below: 10 }
- label: "S"
size: { above: 10, below: 50 }
- label: "M"
size: { above: 50, below: 200 }
- label: "L"
size: { above: 200, below: 500 }
- label: "XL"
size: { above: 500, below: 1000}
- label: "XXL"
size: { above: 1000 }

- label: WIP
title: (?mi)\W*(wip|in progress)\W*

- label: mergeable
mergeable: true

- label: bug
title: (?mi)^\s*(bugfix|fix|bug)\W
- label: bug
branch: (?mi)^(bugfix|fix|bug)/

- label: feature
title: (?mi)^\s*(feature|feat)\W
- label: feature
branch: (?mi)^(feature|feat)/

- label: breaking
title: (?mi)^\s*(breaking)\W

- label: dependencies
title: (?mi)^\s*(dependencies|deps|dep)\W
- label: dependencies
branch: (?mi)^(dependencies|deps|dep)/
- label: dependencies
files:
- go.mod
- go.sum

- label: refactory
title: (?mi)^\s*(refactory|refactor)\W
- label: refactory
branch: (?mi)^(refactory|refactor)/

- label: documentation
title: (?mi)^\s*(documentation|docs|doc)\W
- label: documentation
branch: (?mi)^(documentation|docs|doc)/

- label: chore
title: (?mi)^\s*(chore|misc)\W
- label: chore
branch: (?mi)^(chore|misc)/

- label: ci
title: "(?mi)(ci|deploy):"
- label: ci
branch: (?mi)^(ci|deploy)/
- label: ci
files:
- \.github/.*
- Dockerfile

- label: release
title: (?mi)^\s*(release|releasing)\W
- label: release
branch: (?mi)^(release|releasing)\W
18 changes: 18 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: label issues and PRs

on:
- pull_request
- issues

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: run labeler
uses: srvaroa/labeler@master
with:
config_path: .github/labeler.yaml
use_local_config: false
fail_on_error: false
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
61 changes: 61 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: lint

on:
push:
branches:
- master
pull_request:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check if any go files changed
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
go.sum
*.go
**/*.go
- uses: actions/setup-go@v4
if: steps.changed-files.outputs.any_changed == 'true'
with:
go-version: ^1.21
- name: run golangci-lint
if: steps.changed-files.outputs.any_changed == 'true'
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest

args: --timeout=5m

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
Loading

0 comments on commit fe1dbbe

Please sign in to comment.