更新 license .github

This commit is contained in:
ryan
2026-06-08 17:25:12 +08:00
parent e3ef6c9d27
commit 85f91b1ed7
122 changed files with 881 additions and 215 deletions
+4 -4
View File
@@ -9,7 +9,7 @@ body:
value: |
感谢您花时间填写此 Bug 报告!
- **提交错误报告前**:请检查 [已有 Issues](https://github.com/linux-do/credit/issues)列表,了解是否有类似问题被报告。如果不确定,请进行搜索,这有助于我们高效地专注于改进项目。
- **提交错误报告前**:请检查 [已有 Issues](https://github.com/Rain-kl/Wavelet/issues) 列表,了解是否有类似问题被报告。如果不确定,请进行搜索,这有助于我们高效地专注于改进项目。
- type: checkboxes
id: issue-check
attributes:
@@ -18,7 +18,7 @@ body:
options:
- label: 我已经搜索了现有问题和讨论。
required: true
- label: 我正在使用最新版本或 credit.linux.do 上的此应用。
- label: 我正在使用 wavelet 的最新版本或当前部署实例。
required: true
- type: textarea
id: what-happened
@@ -68,7 +68,7 @@ body:
options:
- label: 我已阅读并遵循了 `README.md` 中的所有说明。
required: true
- label: 我正在使用 linux-do/credit 的最新版本。
- label: 我正在使用 Rain-kl/Wavelet 的最新版本。
required: true
- label: 我已提供我能够提供的尽可能多的相关日志,屏幕截图等。
required: true
@@ -87,4 +87,4 @@ body:
value: |
## 注意
如果 Bug 报告不完整或不遵循说明,则可能不会得到处理。请确保您已遵循所有 **README.md** 指南,并提供所有必要信息以便我们重现该问题。
感谢您为 linux-do/credit 做出贡献!
感谢您为 wavelet 做出贡献!
+4 -4
View File
@@ -9,7 +9,7 @@ body:
value: |
感谢您花时间填写此功能请求!
- **提交功能请求前**:请检查 [已有 Issues](https://github.com/linux-do/credit/issues) 列表和讨论区,了解是否有类似功能已被讨论或请求。这有助于我们避免重复工作,并高效地专注于改进项目。
- **提交功能请求前**:请检查 [已有 Issues](https://github.com/Rain-kl/Wavelet/issues) 列表和讨论区,了解是否有类似功能已被讨论或请求。这有助于我们避免重复工作,并高效地专注于改进项目。
- type: checkboxes
id: check-existing
attributes:
@@ -18,7 +18,7 @@ body:
options:
- label: 我已经搜索了现有问题和讨论。
required: true
- label: 我正在使用最新版本或 credit.linux.do 上的此应用。
- label: 我正在使用 wavelet 的最新版本或当前部署实例。
required: true
- type: textarea
id: feature-description
@@ -65,7 +65,7 @@ body:
options:
- label: 我已阅读并遵循了 `README.md` 中的所有说明。
required: true
- label: 我正在使用 linux-do/credit 的最新版本。
- label: 我正在使用 Rain-kl/Wavelet 的最新版本。
required: true
- label: 我已提供我能够提供的尽可能多的相关信息,包括用例和场景。
required: true
@@ -76,4 +76,4 @@ body:
value: |
## 注意
如果功能请求不完整或不遵循说明,则可能不会得到处理。请确保您已提供所有必要信息以便我们理解您的建议。
感谢您为 linux-do/credit 做出贡献!
感谢您为 wavelet 做出贡献!
+3 -2
View File
@@ -1,7 +1,7 @@
## 基础规范
- 在任何情况都使用简体中文
- 你是一个专业的代码助手,专门为 LINUX DO Credit 项目提供代码编写和优化服务
- 你是一个专业的代码助手,专门为 wavelet 项目提供代码编写和优化服务
- 严格遵循项目的代码规范和最佳实践,确保代码质量和一致性
- 保持代码简洁、可读、高效
- 优先考虑项目的可维护性、性能和安全性,避免引入不必要的复杂性
@@ -10,8 +10,9 @@
- 避免仅修改格式、注释或无影响力的拼写错误
- 重构代码时必须带来可维护性或功能上的实质提升
- 新增功能时考虑向后兼容性和 API 稳定性
- 遵循项目的 MIT 许可证要求
- 遵循项目的 Apache2.0 许可证要求
- 遵循语义化版本控制规范
- 新增异步任务时使用项目技能 `.agent/new-async-task/SKILL.md`
## 后端规范
+3 -3
View File
@@ -2,8 +2,8 @@
<!-- 请在下面的 [ ] 中删除空格并打 x ,表示已完成相关检查 -->
- [ ] 我已阅读并理解 [贡献者公约](https://github.com/linux-do/credit/blob/master/CODE_OF_CONDUCT.md)
- [ ] 我已阅读并同意 [贡献者许可协议 (CLA)](https://github.com/linux-do/credit/blob/master/CLA.md),确认我的贡献将根据项目的 Apache2.0 许可证进行许可
- [ ] 我已阅读并理解 [贡献者公约](https://github.com/Rain-kl/Wavelet/blob/main/CODE_OF_CONDUCT.md)
- [ ] 我已阅读并同意 [贡献者许可协议 (CLA)](https://github.com/Rain-kl/Wavelet/blob/main/CLA.md),确认我的贡献将根据项目的 Apache2.0 许可证进行许可
- [ ] 我知晓如果此 PR 并不做出实质性更改,或可被认为是*为了PR被合并而提交PR*的,则可能不会被合并
**关联信息**
@@ -22,4 +22,4 @@ resolves #1234
**变更原因**
<!-- 请在下方简要描述此 PR 的变更原因 -->
<!-- 请在下方简要描述此 PR 的变更原因 -->
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
+54 -108
View File
@@ -1,58 +1,36 @@
name: Build Docker Image
name: Build Docker Images
on:
push:
branches: [ "master" ]
tags: [ "*" ]
branches:
- "main"
tags:
- "*"
pull_request:
branches: [ "master" ]
branches:
- "main"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
FRONTEND_IMAGE_NAME: ${{ github.repository }}-web
FRONTEND_IMAGE_NAME: ${{ github.repository }}-frontend
BACKEND_IMAGE_NAME: ${{ github.repository }}-backend
# add permission for package publishing
permissions:
contents: read
packages: write
jobs:
build_image:
build_integrated_image:
name: Build integrated image
runs-on: ubuntu-24.04
steps:
# checkout code
- name: Checkout repository
uses: actions/checkout@v4
# set up go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
check-latest: true
# download Go modules
- name: Download Go modules
run: go mod download
# build do
- name: Build Go Binary (multi-arch)
run: |
# build amd64 binary
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o credit-server-amd64 main.go
# build arm64 binary
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o credit-server-arm64 main.go
# show binaries
ls -alh credit-server-*
# set up docker buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# login to registry
- name: Log into registry
uses: docker/login-action@v3
with:
@@ -60,41 +38,38 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# extract metadata for docker
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
type=sha,format=short,prefix=
# build and push docker image
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/master' && github.event_name == 'push') }}
file: docker/Dockerfile
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name == 'push') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build_frontend_image:
name: Build frontend image
runs-on: ubuntu-24.04
steps:
# checkout code
- name: Checkout repository
uses: actions/checkout@v4
# set up docker buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# login to registry
- name: Log into registry
uses: docker/login-action@v3
with:
@@ -102,99 +77,70 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# extract metadata for docker (frontend)
- name: Extract Docker metadata (frontend)
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
type=sha,format=short,prefix=
# generate frontend build date in utc
- name: Generate frontend build date
id: frontend_build_meta
run: echo "build_date=$(date -u +'%Y/%m/%d UTC')" >> "$GITHUB_OUTPUT"
# build and push frontend docker image with version argument
- name: Build Frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./frontend
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/master' && github.event_name == 'push') }}
context: .
file: docker/Dockerfile.frontend
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name == 'push') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ github.ref_type == 'tag' && github.ref_name || '' }}
BUILD_DATE=${{ steps.frontend_build_meta.outputs.build_date }}
update_helm_values:
build_backend_image:
name: Build backend image
runs-on: ubuntu-24.04
needs: [build_image, build_frontend_image]
if: github.ref_type == 'tag'
steps:
# configure SSH agent with deploy key
- name: Setup SSH agent
uses: webfactory/ssh-agent@v0.9.0
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry
uses: docker/login-action@v3
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# add github.com to known_hosts to avoid host verification prompt
- name: Add GitHub to known_hosts
run: ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.BACKEND_IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
type=sha,format=short,prefix=
# clone the helm charts repository
- name: Clone Helm Charts repository
run: git clone ${{ vars.HELM_CHARTS_REPO }} helm-charts
# install yq for yaml editing
- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
# determine helm values file based on tag type (production or test)
- name: Determine Helm values file
id: helm_config
run: |
TAG="${{ github.ref_name }}"
if [[ $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "values_file=values/credit/credit.yaml" >> "$GITHUB_OUTPUT"
echo "branch_prefix=update/credit" >> "$GITHUB_OUTPUT"
else
echo "values_file=values/credit_test/credit.yaml" >> "$GITHUB_OUTPUT"
echo "branch_prefix=update/credit_test" >> "$GITHUB_OUTPUT"
fi
# update image tags in helm values file
- name: Update image tags in helm values file
run: |
cd helm-charts
yq -i '.image.tag = "${{ github.ref_name }}"' ${{ steps.helm_config.outputs.values_file }}
yq -i '.image.webTag = "${{ github.ref_name }}"' ${{ steps.helm_config.outputs.values_file }}
# commit and push to a new branch, then open a PR for review
- name: Commit, push and create PR
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd helm-charts
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
BRANCH_NAME="${{ steps.helm_config.outputs.branch_prefix }}-${{ github.ref_name }}"
git checkout -b "$BRANCH_NAME"
git add ${{ steps.helm_config.outputs.values_file }}
git commit -m "chore: update credit image tag to ${{ github.ref_name }}"
git push origin "$BRANCH_NAME"
HELM_REPO=$(echo "${{ vars.HELM_CHARTS_REPO }}" | sed 's/git@github.com://;s/\.git$//')
gh pr create \
--repo "${HELM_REPO}" \
--title "chore: update credit image tag to ${{ github.ref_name }}" \
--body "Automated PR: update \`${{ steps.helm_config.outputs.values_file }}\` image tags to \`${{ github.ref_name }}\` after Docker image build." \
--base main \
--head "$BRANCH_NAME"
- name: Build Backend Docker image
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile.backend
push: ${{ github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name == 'push') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
-18
View File
@@ -1,18 +0,0 @@
name: check license
on:
push:
branches: [ "master" ]
tags: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
check_license:
runs-on: ubuntu-24.04
steps:
- name: checkout code
uses: actions/checkout@v4
- name: run make add_license
run: make check_license
+1 -1
View File
@@ -28,7 +28,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"
cache: "pnpm"
cache-dependency-path: frontend/pnpm-lock.yaml
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22"
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml