doc: add github action

Signed-off-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
joyceliu 2024-06-28 10:39:52 +08:00
parent 85dbdbd11f
commit 6a821da6e6
14 changed files with 461 additions and 4 deletions

16
.github/.stale.yaml vendored Normal file
View File

@ -0,0 +1,16 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Issues with these labels will never be considered stale
exemptLabels:
- frozen
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Any further update will
cause the issue/pull request to no longer be considered stale. Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue is being automatically closed due to inactivity.

54
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@ -0,0 +1,54 @@
name: Bug Report
description: File a bug report
labels: [bug]
body:
- type: markdown
id: preface
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: markdown
id: environment
attributes:
value: "## Environment"
- type: input
id: version
validations:
required: true
attributes:
label: What is version of KubeKey has the issue?
description: "You can use the command to get `./kk version`"
- type: input
id: os
validations:
required: true
attributes:
label: What is your os environment?
description: "e.g. Ubuntu 16.04"
- type: textarea
id: config
attributes:
label: KubeKey config file
description: "If applicable, add the KubeKey config file content to help explain your problem."
render: yaml
- type: markdown
id: main
attributes:
value: "## Main"
- type: textarea
id: what
validations:
required: true
attributes:
label: A clear and concise description of what happend.
- type: textarea
id: logs
attributes:
label: "Relevant log output"
description: "Please copy and paste any relevant log output."
render: shell
- type: textarea
id: additional-information
attributes:
label: "Additional information"
description: "Add any other context about the information here (screenshots, video, etc.)."

5
.github/ISSUE_TEMPLATE/custom.yaml vendored Normal file
View File

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Any other questions about KubeKey
url: https://kubesphere.slack.com/
about: If you have any other questions, you can join our slack channel.

View File

@ -0,0 +1,38 @@
name: Feature Request
description: File a feature request
body:
- type: markdown
id: preface
attributes:
value: "Thank you for submitting new features for KubeKey."
- type: markdown
id: environment
attributes:
value: "## Environment"
- type: input
id: version
attributes:
label: "Your current KubeKey version"
description: "You can use the command to get `./kk version`"
- type: markdown
id: main
attributes:
value: "## Main"
- type: textarea
id: description
attributes:
label: "Describe this feature"
validations:
required: true
- type: textarea
id: solution
attributes:
label: "Describe the solution you'd like"
description: "You can have a concise description of any alternative solutions or ideas you've considered."
validations:
required: true
- type: textarea
id: additional-information
attributes:
label: "Additional information"
description: "Add any other context about the information here (screenshots, video, etc.)."

17
.github/OWNERS vendored Normal file
View File

@ -0,0 +1,17 @@
approvers:
- pixiake
- rayzhou2017
- LinuxSuRen
- ImitationImmortal
reviewers:
- pixiake
- rayzhou2017
- zryfish
- benjaminhuo
- calvinyv
- FeynmanZhou
- huanggze
- wansir
- LinuxSuRen
- ImitationImmortal

64
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,64 @@
<!-- Thanks for sending a pull request! Here are some tips for you:
1. If you want **faster** PR reviews, read how: https://github.com/kubesphere/community/blob/master/developer-guide/development/the-pr-author-guide-to-getting-through-code-review.md
2. In case you want to know how your PR got reviewed, read: https://github.com/kubesphere/community/blob/master/developer-guide/development/code-review-guide.md
3. Here are some coding conventions followed by KubeSphere community: https://github.com/kubesphere/community/blob/master/developer-guide/development/coding-conventions.md
-->
### What type of PR is this?
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind design
/kind dependencies
/kind test
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
### What this PR does / why we need it:
### Which issue(s) this PR fixes:
<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #
### Special notes for reviewers:
```
```
### Does this PR introduced a user-facing change?
<!--
If no, just write "None" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
For more information on release notes see: https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md
-->
```release-note
```
### Additional documentation, usage docs, etc.:
<!--
This section can be blank if this pull request does not require a release note.
Please use the following format for linking documentation or pass the
section below:
- [KEP]: <link>
- [Usage]: <link>
- [Other doc]: <link>
-->
```docs
```

14
.github/dependabot.yml vendored Normal file
View File

@ -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: "-"

41
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,41 @@
# 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'
- 'kind/feature'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'regression'
- 'kind/bug'
- title: 📝 Documentation updates
labels:
- 'documentation'
- 'kind/documentation'
- title: 👻 Maintenance
labels:
- chore
- dependencies
- 'kind/cleanup'
- title: 🚦 Tests
labels:
- test
- tests
exclude-labels:
- reverted
- no-changelog
- skip-changelog
- invalid
change-template: '* $TITLE (#$NUMBER) @$AUTHOR'
template: |
## Whats Changed
$CHANGES

68
.github/settings.yml vendored Normal file
View File

@ -0,0 +1,68 @@
repository:
name: kubekey
description: "KubeKey provides a flexible, rapid and convenient way to install Kubernetes only, both Kubernetes and KubeSphere, and related cloud-native add-ons. It is also an efficient tool to scale and upgrade your cluster."
homepage: https://kubesphere.io/
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: These're friendly issues for new comers
- 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
- name: priority-high
color: D93F0B
- name: priority-medium
color: FBCA04
- name: priority-low
color: 006B75
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: []

65
.github/workflows/build-multiarch.yaml vendored Normal file
View File

@ -0,0 +1,65 @@
name: BuildContainerImage
on:
push:
tags:
- 'v4*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.repository == 'kubesphere/kubekey'
env:
GO111MODULE: on
steps:
- name: Prepare
id: prepare
run: |
VERSION=latest
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Aliyun
uses: docker/login-action@v3
with:
registry: registry.cn-beijing.aliyuncs.com
username: ${{ secrets.ALIYUNCS_USERNAME }}
password: ${{ secrets.ALIYUNCS_PASSWORD }}
- name: Login to Hub_Kubesphere
uses: docker/login-action@v3
with:
registry: hub.kubesphere.com.cn
username: ${{ secrets.HUB_KUBESPHERE_USERNAME }}
password: ${{ secrets.HUB_KUBESPHERE_PASSWORD }}
- name: Login to DOCKER
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
run: |
tag=${{ steps.prepare.outputs.version }}
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
REGISTRY=docker.io/kubesphere TAG=$tag make docker-build
else
REGISTRY=docker.io/kubespheredev TAG=$tag make docker-build
fi

41
.github/workflows/goreleaser.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: goreleaser
on:
push:
tags:
- 'v4*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
if: github.repository == 'kubesphere/kubekey'
steps:
- name: Prepare
id: prepare
run: |
LDFLAGS=$(shell hack/version.sh)
echo "ldflags=${LDFLAGS}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LDFLAGS: ${{ steps.prepare.outputs.ldflags }}

33
.goreleaser.yml Normal file
View File

@ -0,0 +1,33 @@
env:
- GO111MODULE=on
- CGO_ENABLED=0
before:
hooks:
- go mod tidy
builds:
- main: ./cmd/kk/kubekey.go
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
binary: kubekey
ldflags: "{{ .Env.LDFLAGS }}"
flags:
- builtin
archives:
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- none*
release:
prerelease: auto
universal_binaries:
- replace: true

View File

@ -89,10 +89,11 @@ DOCKERCMD ?= $(shell which docker)
DOCKER_BUILD_ENV = DOCKER_BUILDKIT=1
DOCKER_BUILD ?= $(DOCKER_BUILD_ENV) $(DOCKERCMD) buildx build
PLATFORM ?= linux/amd64,linux/arm64
DOCKER_PUSH ?= $(DOCKER_BUILD) --platform $(PLATFORM) --push
DOCKER_OUT_TYPE ?= --push
DOCKER_PUSH ?= $(DOCKER_BUILD) --platform $(PLATFORM) $(DOCKER_OUT_TYPE)
# Define Docker related variables. Releases should modify and double check these vars.
REGISTRY ?= hub.kubesphere.com.cn/kubekey
REGISTRY ?= docker.io/kubespheredev
#REGISTRY ?= docker.io/kubespheredev
#PROD_REGISTRY ?= docker.io/kubesphere

4
OWNERS
View File

@ -2,7 +2,7 @@ approvers:
- pixiake
- 24sama
- rayzhou2017
- littleBlackHouse
- ImitationImmortal
reviewers:
- pixiake
@ -15,4 +15,4 @@ reviewers:
- wansir
- LinuxSuRen
- 24sama
- littleBlackHouse
- ImitationImmortal