Skip to content

Commit

Permalink
Merge branch 'OpenIMSDK:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarishT committed Aug 5, 2023
2 parents 6364de5 + 7a558a2 commit f2d876a
Show file tree
Hide file tree
Showing 210 changed files with 15,122 additions and 1,246 deletions.
6 changes: 6 additions & 0 deletions .github/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# https://github.com/BetaHuhn/repo-file-sync-action
# Synchronization for the.github repository
openkf/openkf:
- source: ./
dest: ./
replace: true
29 changes: 29 additions & 0 deletions .github/workflows/auto-assign-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Assign issue to comment author
on:
issue_comment:
types: [created]
jobs:
assign-issue:
if: |
contains(github.event.comment.body, '/assign') || contains(github.event.comment.body, '/accept') &&
!contains(github.event.comment.user.login, 'openimbot') &&
!contains(github.event.comment.user.login, 'kubbot')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Assign the issue
run: |
export LETASE_MILESTONES=$(curl 'https://api.github.com/repos/$OWNER/$PEPO/milestones' | jq -r 'last(.[]).title')
gh issue edit ${{ github.event.issue.number }} --add-assignee "${{ github.event.comment.user.login }}"
gh issue edit ${{ github.event.issue.number }} --add-label "triage/accepted"
gh issue edit ${{ github.event.issue.number }} --milestone "$LETASE_MILESTONES"
gh issue comment $ISSUE --body "@${{ github.event.comment.user.login }} Glad to see you accepted this issue🤲, this issue has been assigned to you. I set the milestones for this issue to [$LETASE_MILESTONES](https://github.com/$OWNER/$PEPO/milestones), We are looking forward to your PR!"
env:
GH_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
56 changes: 56 additions & 0 deletions .github/workflows/auto-gh-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Auto PR to release

on:
pull_request:
# types:
# - closed

jobs:
create-pr:
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'main'
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup GitHub CLI
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt-get update
sudo apt-get install gh
continue-on-error: true

# - name: Configure GitHub CLI
# run: |
# git config --global user.email "3293172751ysy@gmail.com"
# git config --global user.name "kubbot"
# echo "${{ secrets.BOT_GITHUB_TOKEN }}" | gh auth login --with-token
- name: Create PR to release branch
run: |
ISSUEID=$(gh pr view ${{ github.event.pull_request.number }} --repo $OWNER/$REPO | grep -oP 'Fixes #\K\d+')
echo "===========> $ISSUEID"
ISSUE=$(gh issue view $ISSUEID --repo $OWNER/$REPO --json labels,assignees,milestone,title)
echo "===========> $ISSUE"
LABELS=$(echo $ISSUE | jq -r '.labels[] | select(.name) | .name' | jq -R -r -s -c 'split("\n")[:-1] | join(",")')
ASSIGNEES=$(echo $ISSUE | jq -r '.assignees[] | select(.login) | .login' | jq -R -s -c 'split("\n")[:-1] | join(",")')
MILESTONE=$(echo $ISSUE | jq -r '.milestone | select(.title) | .title')
TITLE=$(echo $ISSUE | jq -r '.title')
gh pr edit ${{ github.event.pull_request.number }} --repo $OWNER/$REPO --add-label "$LABELS" --add-assignee "$ASSIGNEES" --milestone "$MILESTONE"
git checkout -b bot/merge-to-release-$ISSUEID
git push origin bot/merge-to-release-$ISSUEID
gh pr create --base release --head bot/merge-to-release-$ISSUEID --title "Merge main to release" --body ""
# gh pr create --base main --head feat/auto-release-pr-624 --title "The bug is fixed" --body "$x" --repo OpenIMSDK/Open-IM-Server --reviewer "cubxxw"
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}
ISSUE: ${{ github.event.issue.html_url }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
48 changes: 48 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "OpenIM CLA Assistant"
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened,closed,synchronize]

# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
permissions:
actions: write
contents: write
pull-requests: write
statuses: write

env:
# Define Open-IM-Server variables here
OPEN_IM_SERVER_REMOTE_ORGANIZATION: openim-sigs
REMOTE_REPOSITORY: cla
OPEN_IM_SERVER_CLA_DOCUMENT: https://github.com/openim-sigs/cla/blob/main/README.md
OPEN_IM_SERVER_SIGNATURES_PATH: signatures/${{ github.event.repository.name }}/cla.json

OPEN_IM_SERVER_ALLOWLIST: kubbot,bot*

jobs:
CLAAssistant:
runs-on: ubuntu-latest
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
uses: contributor-assistant/github-action@v2.3.0
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
with:
path-to-signatures: ${{ env.OPEN_IM_SERVER_SIGNATURES_PATH }}
path-to-document: ${{ env.OPEN_IM_SERVER_CLA_DOCUMENT }}
branch: 'main'
allowlist: ${{ env.OPEN_IM_SERVER_ALLOWLIST }}

remote-organization-name: ${{ env.OPEN_IM_SERVER_REMOTE_ORGANIZATION }}
remote-repository-name: ${{ env.REMOTE_REPOSITORY }}

create-file-commit-message: '📚 Docs: Creating file for storing ${{ github.event.repository.name }} CLA Signatures'
custom-notsigned-prcomment: '💕 Thank you for your contribution and please kindly read and sign our [🎯https://github.com/openim-sigs/cla/blob/main/README.md](https://github.com/openim-sigs/cla/blob/main/README.md). <br> If you wish to sign the CRA, **Please copy and comment on the following sentence:**'
custom-pr-sign-comment: 'I have read the CLA Document and I hereby sign the CLA'
custom-allsigned-prcomment: '🤖 All Contributors have signed the [${{ github.event.repository.name }} CLA](https://github.com/openim-sigs/cla/blob/main/README.md).<br> The signed information is recorded [🤖here](https://github.com/openim-sigs/cla/tree/main/signatures/${{ github.event.repository.name }}/cla.json)'
# lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
# use-dco-flag: true - If you are using DCO instead of CLA
3 changes: 3 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# name: OpenIM e2e Test
# test/e2e/...
# go rod : https://github.com/go-rod/rod
62 changes: 48 additions & 14 deletions .github/workflows/kubekf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,25 @@ name: OpenKF CI

on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "README.md"
- "README_zh-CN.md"
- "CONTRIBUTING.md"
pull_request:
branches:
- main
paths-ignore:
- "README.md"
- "README_zh-CN.md"
- "CONTRIBUTING.md"
- "docs/**"

env:
GO_VERSION: "1.19"
GOLANGCI_VERSION: "v1.50.1"

jobs:
openkf:
Expand All @@ -27,7 +45,7 @@ jobs:

strategy:
matrix:
go_version: ["1.20"]
go_version: ["1.19","1.20"]
os: [ubuntu-latest]

steps:
Expand Down Expand Up @@ -61,9 +79,18 @@ jobs:
run: |
make cover
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go

- name: Build source code for host platform
run: |
make build # skip build for now
sudo make build
echo "Build source code for host platform successfully"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

- name: Collect Test Coverage File
uses: actions/upload-artifact@v1.0.0
Expand All @@ -74,15 +101,22 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

# skip for now
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ env.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# skip for now
# - name: Build docker images for host arch and push images to registry
# run: |
# set -e
# make docker-push
docker-image-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Run tests
run: make build

- name: Test docker image
run: |
docker build -t openkf:ci-build .
13 changes: 5 additions & 8 deletions .github/workflows/project-progress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Move assigned card
name: Move new issues into Triage

on:
issues:
types:
- assigned
pull_request:
types:
- assigned
types: [opened]

jobs:
move-assigned-card:
automate-project-columns:
runs-on: ubuntu-latest
steps:
- uses: alex-page/github-project-automation-plus@v0.8.3
with:
project: OpenKF
column: In Progress
repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: goreleaser

on:
push:
tags:
- '*'
permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
1 change: 0 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ on:

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright © 2023 KubeCub open source community. All rights reserved.
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.

# https://github.com/BetaHuhn/repo-file-sync-action
name: Synchronize kubecub public code to other repositories
on:
push:
branches:
- main
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run GitHub File Sync
uses: BetaHuhn/repo-file-sync-action@latest
with:
GH_INSTALLATION_TOKEN: "${{ secrets.BOT_GITHUB_TOKEN }}"
CONFIG_PATH: .github/sync.yml
ORIGINAL_MESSAGE: true
SKIP_PR: true
COMMIT_EACH_FILE: false
COMMIT_BODY: "🤖 kubbot to synchronize the warehouse"
GIT_EMAIL: "3293172751ysy@gmail.com"
GIT_USERNAME: "kubbot"
PR_BODY: 👌 kubecub provides automated community services
REVIEWERS: |
kubbot
cubxxw
PR_LABELS: |
file-sync
automerge
ASSIGNEES: |
kubbot
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea
.idea/

# User-specific stuff
.idea/**/workspace.xml
Expand Down Expand Up @@ -343,13 +343,16 @@ flycheck_*.el

# Misc
.DS_Store
*.env
.env.*
# Add env to web
# *.env
# .env.*
dist

# files used by the developer
.idea.md
.todo.md
.note.md

# config files, may contain sensitive information
# config files, may contain sensitive information
dist/

2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ linters-settings:
max-blank-identifiers: 2
dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
threshold: 200
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
Expand Down
Loading

0 comments on commit f2d876a

Please sign in to comment.