Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
vscodev committed Feb 21, 2025
0 parents commit fc6a312
Show file tree
Hide file tree
Showing 14 changed files with 672 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Bug report"
description: Bug report
labels: [bug]
body:
- type: markdown
attributes:
value: |
感谢你花时间填写此错误报告,请 **务必确认你的issue不是重复的且不是因为你的操作或版本问题** 。
- type: checkboxes
attributes:
label: 请确认以下内容
description: |
你必须勾选以下所有内容,否则你的issue可能会被直接关闭。或者你可以去 [讨论区](https://github.com/vscodev/kikoeru/discussions) 。
options:
- label: |
我确定使用的是 `Kikoeru` 的最新版本。
- label: |
我确定没有重复的issue或讨论。
- label: |
我确定是程序本身的问题,而不是其他原因(例如 `网络` ,`依赖` 或 `操作` )。
- type: input
id: version
attributes:
label: Kikoeru 版本
description: |
你使用的是哪个版本的软件?你可以在 `仪表盘` -> `系统信息` -> `程序版本` 中找到。
placeholder: "0.1.0"
validations:
required: true
- type: input
id: driver
attributes:
label: 使用的存储驱动
description: |
你使用的是哪个存储驱动?
placeholder: "OneDrive"
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: 问题描述
validations:
required: true
- type: textarea
id: logs
attributes:
label: 日志
description: |
请复制粘贴错误日志,或者截图。
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Discussions
url: https://github.com/vscodev/kikoeru/discussions
about: Use GitHub discussions for message-board style questions and discussions.
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Feature request"
description: Feature request
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: 请确认以下所有内容
description: |
你必须勾选以下所有内容,否则你的issue可能会被直接关闭。或者你可以去 [讨论区](https://github.com/vscodev/kikoeru/discussions) 。
options:
- label: |
我确定使用的是 `Kikoeru` 的最新版本。
- label: |
我确定没有重复的issue或讨论。
- label: |
我确定这是一个受众需求而不是单纯出于个人意愿,并且当前没有被实现。
- type: textarea
id: feature-description
attributes:
label: 需求描述
validations:
required: true
- type: textarea
id: suggested-solution
attributes:
label: 实现思路
description: |
实现此需求的解决思路。
- type: textarea
id: additional-context
attributes:
label: 附件
description: |
相关的任何其他上下文或截图,或者你觉得有帮助的信息。
19 changes: 19 additions & 0 deletions .github/workflows/close-inactive-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Close inactive issues

on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
permissions:
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 30
days-before-close: 5
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 5 days since being marked as stale."
59 changes: 59 additions & 0 deletions .github/workflows/docker-image-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish Docker dev image

on:
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ secrets.GH_REPO }}
token: ${{ secrets.GH_PAT }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'web/package.json'
check-latest: true

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Build frontend
run: |
pnpm install
pnpm build
cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/
working-directory: ./web

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: true
tags: ghcr.io/vscodev/kikoeru:dev
156 changes: 156 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Publish Docker image

on:
workflow_dispatch:

permissions:
contents: read
packages: write

jobs:
build:
name: Build
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- platform: "linux/amd64"
arch: "amd64"
toolchain: "x86_64-linux-musl-cross"
cc: "x86_64-linux-musl-gcc"
- platform: "linux/arm64"
arch: "arm64"
toolchain: "aarch64-linux-musl-cross"
cc: "aarch64-linux-musl-gcc"
- platform: "linux/386"
arch: "386"
toolchain: "i486-linux-musl-cross"
cc: "i486-linux-musl-gcc"
- platform: "linux/s390x"
arch: "s390x"
toolchain: "s390x-linux-musl-cross"
cc: "s390x-linux-musl-gcc"
- platform: "linux/riscv64"
arch: "riscv64"
toolchain: "riscv64-linux-musl-cross"
cc: "riscv64-linux-musl-gcc"
- platform: "linux/ppc64le"
arch: "ppc64le"
toolchain: "powerpc64le-linux-musl-cross"
cc: "powerpc64le-linux-musl-gcc"
- platform: "linux/arm/v6"
arch: "arm"
arm: "6"
toolchain: "armv6-linux-musleabihf-cross"
cc: "armv6-linux-musleabihf-gcc"
- platform: "linux/arm/v7"
arch: "arm"
arm: "7"
toolchain: "armv7l-linux-musleabihf-cross"
cc: "armv7l-linux-musleabihf-gcc"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ secrets.GH_REPO }}
token: ${{ secrets.GH_PAT }}
fetch-depth: 0

- name: Checkout latest version
run: |
version=$(git describe --tags --abbrev=0)
git checkout "$version"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'web/package.json'
check-latest: true

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Build frontend
run: |
pnpm install
pnpm build
cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/
working-directory: ./web

- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Install toolchains
run: |
curl -L -o "${{matrix.toolchain}}.tgz" "https://musl.cc/${{matrix.toolchain}}.tgz"
sudo tar xf "${{matrix.toolchain}}.tgz" --strip-components 1 -C /usr/local
- name: Build
run: |
go mod download
export GOARCH=${{ matrix.arch }}
if [[ -n "${{ matrix.arm }}" ]]; then
export GOARM=${{ matrix.arm }}
fi
export CC=${{ matrix.cc }}
bash build.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.PLATFORM_PAIR }}
path: kikoeru
if-no-files-found: error
retention-days: 1

push:
needs: build
name: Push
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ secrets.GH_REPO }}
token: ${{ secrets.GH_PAT }}

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: build

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push
uses: docker/build-push-action@v6
with:
context: .
file: ci.Dockerfile
platforms: "linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64"
push: true
tags: ghcr.io/vscodev/kikoeru:latest
Loading

0 comments on commit fc6a312

Please sign in to comment.