Skip to content

Commit 0f72a1c

Browse files
committed
提交功能代码
1 parent 1405e9b commit 0f72a1c

28 files changed

+772
-128
lines changed

.github/ISSUE_TEMPLATE/question.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: 🙋 问题交流
3+
about: 有任何问题,都可以在这里交流。
4+
title: "🙋 简明扼要起个标题"
5+
labels: ["question"]
6+
---
7+
8+
## 问题反馈
9+
10+
- 搜索打开和关闭的 [GitHub 问题](https://github.com/eryajf/chatgpt-dingtalk/issues),请勿重复提交issue。
11+
12+
**重要:提交问题时,请务必带上输出日志,以及个人排查的成果。**

.github/pull-request-template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
**在提出此拉取请求时,我确认了以下几点(请复选框):**
3+
4+
- [ ] 我已阅读并理解[贡献者指南](https://github.com/eryajf/chatgpt-dingtalk/blob/main/CONTRIBUTING.md)
5+
- [ ] 我已检查没有与此请求重复的拉取请求。
6+
- [ ] 我已经考虑过,并确认这份呈件对其他人很有价值。
7+
- [ ] 我接受此提交可能不会被使用,并根据维护人员的意愿关闭拉取请求。

.github/release-drafter.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
2+
name-template: 'v$NEXT_PATCH_VERSION 🌈'
3+
tag-template: 'v$NEXT_PATCH_VERSION'
4+
version-template: $MAJOR.$MINOR.$PATCH
5+
# Emoji reference: https://gitmoji.carloscuesta.me/
6+
categories:
7+
- title: '🚀 Features'
8+
labels:
9+
- 'feature'
10+
- 'enhancement'
11+
- 'kind/feature'
12+
- title: '🐛 Bug Fixes'
13+
labels:
14+
- 'fix'
15+
- 'bugfix'
16+
- 'bug'
17+
- 'regression'
18+
- 'kind/bug'
19+
- title: 📝 Documentation updates
20+
labels:
21+
- 'doc'
22+
- 'documentation'
23+
- 'kind/doc'
24+
- title: 👻 Maintenance
25+
labels:
26+
- chore
27+
- dependencies
28+
- 'kind/chore'
29+
- 'kind/dep'
30+
- title: 🚦 Tests
31+
labels:
32+
- test
33+
- tests
34+
exclude-labels:
35+
- reverted
36+
- no-changelog
37+
- skip-changelog
38+
- invalid
39+
change-template: '* $TITLE (#$NUMBER) @$AUTHOR'
40+
template: |
41+
## What’s Changed
42+
$CHANGES

.github/workflows/docker-image.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: build docker image
4+
5+
# Controls when the action will run.
6+
on:
7+
push:
8+
branches:
9+
- main
10+
release:
11+
types: [created,published] # 表示在创建新的 Release 时触发
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
# 可以手动触发
15+
workflow_dispatch:
16+
inputs:
17+
logLevel:
18+
description: 'Log level'
19+
required: true
20+
default: 'warning'
21+
tags:
22+
description: 'Test scenario tags'
23+
24+
jobs:
25+
buildx:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
31+
- name: Inject slug/short variables
32+
uses: rlespinasse/github-slug-action@v4
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v1
36+
37+
- name: Set up Docker Buildx
38+
id: buildx
39+
uses: docker/setup-buildx-action@v1
40+
41+
- name: Available platforms
42+
run: echo ${{ steps.buildx.outputs.platforms }}
43+
44+
- name: Login to DockerHub
45+
uses: docker/login-action@v1
46+
with:
47+
username: ${{ secrets.DOCKERHUB_USERNAME }}
48+
password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
50+
- name: Build and push
51+
uses: docker/build-push-action@v2
52+
with:
53+
context: .
54+
file: ./Dockerfile
55+
# 所需要的体系结构,可以在 Available platforms 步骤中获取所有的可用架构
56+
platforms: linux/amd64,linux/arm64/v8
57+
# 镜像推送时间
58+
push: ${{ github.event_name != 'pull_request' }}
59+
# 给清单打上多个标签
60+
tags: |
61+
${{ secrets.DOCKERHUB_USERNAME }}/cloudctl:${{ env.GITHUB_REF_NAME }}
62+
${{ secrets.DOCKERHUB_USERNAME }}/cloudctl:latest
63+
64+
# 镜像推送到 ghcr
65+
# - name: Login to the GitHub Container Registry
66+
# uses: docker/login-action@v2
67+
# with:
68+
# registry: ghcr.io
69+
# username: ${{ github.actor }}
70+
# password: ${{ secrets.GITHUB_TOKEN }}
71+
72+
# - name: Build and push image:latest
73+
# uses: docker/build-push-action@v3
74+
# with:
75+
# context: .
76+
# push: true
77+
# platforms: linux/amd64,linux/arm64
78+
# tags: |
79+
# ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/cloudctl:${{ env.GITHUB_REF_NAME }}
80+
# ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/cloudctl:latest
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: build
2+
3+
on:
4+
release:
5+
types: [created,published] # 表示在创建新的 Release 时触发
6+
7+
jobs:
8+
build-go-binary:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
goos: [linux, windows, darwin] # 需要打包的系统
13+
goarch: [amd64, arm64] # 需要打包的架构
14+
exclude: # 排除某些平台和架构
15+
- goarch: arm64
16+
goos: windows
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: wangyoucao577/go-release-action@v1.30
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }} # 一个默认的变量,用来实现往 Release 中添加文件
22+
goos: ${{ matrix.goos }}
23+
goarch: ${{ matrix.goarch }}
24+
goversion: 1.18 # 可以指定编译使用的 Golang 版本
25+
binary_name: "cloudctl" # 可以指定二进制文件的名称
26+
extra_files: LICENSE config.example.yml project_list.example.yml README.md # 需要包含的额外文件
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Generate a list of contributors
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
contrib-readme-en-job:
10+
runs-on: ubuntu-latest
11+
name: A job to automate contrib in readme
12+
steps:
13+
- name: Contribute List
14+
uses: akhilmhdh/contributors-readme-action@v2.3.6
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
with:
18+
image_size: 75
19+
columns_per_row: 8
20+
commit_message: '🫶 更新贡献者列表'

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- main
8+
# pull_request event is required only for autolabeler
9+
pull_request:
10+
# Only following types are handled by the action, but one can default to all as well
11+
types: [opened, reopened, synchronize]
12+
# pull_request_target event is required for autolabeler to support PRs from forks
13+
# pull_request_target:
14+
# types: [opened, reopened, synchronize]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
update_release_draft:
21+
permissions:
22+
contents: write # for release-drafter/release-drafter to create a github release
23+
pull-requests: write # for release-drafter/release-drafter to add label to PR
24+
runs-on: ubuntu-latest
25+
steps:
26+
# (Optional) GitHub Enterprise requires GHE_HOST variable set
27+
#- name: Set GHE_HOST
28+
# run: |
29+
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
30+
31+
# Drafts your next Release notes as Pull Requests are merged into "master"
32+
- uses: release-drafter/release-drafter@v5
33+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
34+
# with:
35+
# config-name: my-config.yml
36+
# disable-autolabeler: true
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/toc.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
on: push
2+
name: Automatic Generation TOC
3+
jobs:
4+
generateTOC:
5+
name: TOC Generator
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: technote-space/toc-generator@v4
9+
with:
10+
TOC_TITLE: "**目录**"
11+
MAX_HEADER_LEVEL: 4

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
.token
1010

1111
logs
12-
eryajfctl
12+
cloudctl
13+
config.yml
1314

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

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV GOPROXY https://goproxy.io
55
RUN mkdir /app
66
ADD . /app/
77
WORKDIR /app
8-
RUN go build -o eryajfctl .
8+
RUN go build -o cloudctl .
99

1010
FROM alpine:3.16
1111

@@ -20,4 +20,4 @@ RUN mkdir /app && apk upgrade \
2020

2121
WORKDIR /app
2222
COPY --from=builder /app/ .
23-
RUN chmod +x eryajfctl && cp config.example.yml config.yml
23+
RUN chmod +x cloudctl && cp config.example.yml config.yml

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
default: build
22

33
build:
4-
go build -o eryajfctl main.go
4+
go build -o cloudctl main.go
55

66
build-linux:
7-
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o eryajfctl main.go
7+
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o cloudctl main.go
88

99
lint:
1010
env GOGC=25 golangci-lint run --fix -j 8 -v ./...

0 commit comments

Comments
 (0)