fix: actions milestones auto (#642)

* fix: actions milestones auto

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add org server secret

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: fix scripts

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add file:

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add file:

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

* feat: add file:

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/648/head
Xinwei Xiong 1 year ago committed by GitHub
parent 9ef94ad46b
commit f9406108aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

3
.github/sync.yml vendored

@ -94,9 +94,6 @@ group:
- source: .github/workflows/cla.yml
dest: .github/workflows/cla.yml
replace: false
- source: .github/workflows/
dest: .github/workflows/
replace: false
- source: .github/workflows/auto-assign-issue.yml
dest: .github/workflows/auto-assign-issue.yml
replace: false

@ -0,0 +1,57 @@
name: Auto PR to release
on:
pull_request:
# types:
# - closed
env:
GH_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
jobs:
create-pr:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && 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 642 --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')
echo $ISSUE | jq
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"

@ -14,7 +14,7 @@ jobs:
- name: Assign the issue
run: |
export LETASE_MILESTONES=$(curl 'https://api.github.com/repos/kubecub/github-label-syncer/milestones' | jq -r 'last(.[]).title')
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"

@ -1,45 +1,45 @@
# name: Check-Coverage
name: Check-Coverage
# on:
# workflow_dispatch:
# push:
# branches: [ "main" ]
# paths-ignore:
# - "docs/**"
# - "**/*.md"
# - "**/*.yaml"
# - "CONTRIBUTORS"
# - "CHANGELOG/**"
# pull_request:
# branches: [ "*" ]
# paths-ignore:
# - "docs/**"
# - "**/*.md"
# - "**/*.yaml"
# - "CONTRIBUTORS"
# - "CHANGELOG/**"
# env:
# # Common versions
# GO_VERSION: "1.20"
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.yaml"
- "CONTRIBUTORS"
- "CHANGELOG/**"
pull_request:
branches: [ "*" ]
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.yaml"
- "CONTRIBUTORS"
- "CHANGELOG/**"
env:
# Common versions
GO_VERSION: "1.20"
# jobs:
# coverage:
# runs-on: ubuntu-20.04
# steps:
# - name: Checkout
# uses: actions/checkout@v3
jobs:
coverage:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
# - name: Setup Golang with cache
# uses: magnetikonline/action-golang-cache@v3
# with:
# go-version: ${{ env.GO_VERSION }}
# token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v3
with:
go-version: ${{ env.GO_VERSION }}
# - name: Install Dependencies
# run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
- name: Install Dependencies
run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
# - name: Run Cover
# run: make cover
- name: Run Cover
run: make cover
continue-on-error: true
# - name: Upload Coverage to Codecov
# uses: codecov/codecov-action@v3
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3

@ -41,8 +41,8 @@ jobs:
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> '
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/${{ env.OPEN_IM_SERVER_ALLOWLIST }}/cla.json)'
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

@ -1,2 +1,2 @@
# name: OpenIM e2e Test
# name: OpenIM e2e Test

@ -90,11 +90,19 @@ jobs:
echo "Run unit test and get test coverage successfully"
continue-on-error: true
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
- name: Build source code for host platform
run: |
sudo make build
echo "Build source code for host platform successfully"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: OpenIM verify copyright
run: |
sudo make verify-copyright

@ -33,4 +33,4 @@ jobs:
with:
project: OpenIM-V3.1
column: In Progress
repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
repo-token: ${{ secrets.GITHUB_TOKEN }}

@ -0,0 +1,39 @@
name: Github Pull Request
on:
push:
branches: [main]
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'docs/**'
pull_request:
branches: [main]
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'docs/**'
permissions:
pull-requests: write
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
commit-message: 'build: update distribution'
title: 'build: update distribution'
body: |
- Updates the distribution for changes on `main`
Auto-generated by [create-pull-request][1]
[1]: https://github.com/OpenIMSDK/Open-IM-Sever
branch: 'bot/update-distribution'

@ -58,6 +58,7 @@ run:
skip-files:
- ".*\\.my\\.go$"
- _test.go
- ".*\\.pb\\.go"
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit

@ -2,28 +2,28 @@
# Each line is a file pattern followed by one or more owners.
# README files
README.md @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
README.md @openimsdk/openim @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# Contributing guidelines
CONTRIBUTING.md @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
CONTRIBUTING.md @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# License files
LICENSE @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
LICENSE @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# Makefile
Makefile @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
Makefile @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @cubxxw and @kubbot will be requested for
# @cubxxw and @openimsdk/bot will be requested for
# review when someone opens a pull request.
* @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
* @openimsdk/openim @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
*.js @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
*.js @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
@ -35,16 +35,16 @@ Makefile @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-
# be identified in the format @org/team-name. Teams must have
# explicit write access to the repository. In this example,
# the OpenIMSDK team in the github organization owns all .txt files.
*.txt @cubxxw @kubbot @Bloomingg @FGadvancer @hrxiang @Oliver-WJ @skiffer-git @std-s @wangchuxiao-dev @withchao
*.txt @cubxxw @openimsdk/bot @Bloomingg @FGadvancer @skiffer-git @wangchuxiao-dev @withchao
# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
docs/* 3293172751nss@gmail.com @kubbot @skiffer-git
docs/* 3293172751nss@gmail.com @openimsdk/bot @skiffer-git
# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
api/ @cubxxw @IRONICBo @skiffer-git
api/ @openimsdk/openim @cubxxw @skiffer-git
# This is a comment.
# Each line is a file pattern followed by one or more owners.
@ -65,24 +65,24 @@ cmd/*
config/* @skiffer-git
# db directory
db/sdk @77caleb @BanTanger @cubxxw @Gordon
db/sdk @BanTanger @cubxxw @Gordon
# internal directory
internal/ @skiffer-git @FGadvancer
internal/ @openimsdk/openim @skiffer-git @FGadvancer
# logs directory
logs/* @skiffer-git @FGadvancer
logs/* @skiffer-git @FGadvancer
# pkg directory
pkg/a2r @skiffer-git
pkg/a2r @openimsdk/openim @skiffer-git @cubxxw @openimsdk/bot
# scripts directory
scripts/LICENSE/* @cubxxw @skiffer-git @FGadvancer
scripts/enterprise/* @FGadvancer @cubxxw @skiffer-git @kubbot
scripts/githooks/* @cubxxw @skiffer-git @FGadvancer
scripts/lib/* @FGadvancer @cubxxw @skiffer-git @kubbot
scripts/make-rules/* @FGadvancer @cubxxw @skiffer-git @kubbot
scripts/LICENSE/* @openimsdk/openim @cubxxw @skiffer-git @FGadvancer
scripts/enterprise/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
scripts/githooks/* @openimsdk/openim @cubxxw @skiffer-git @FGadvancer
scripts/lib/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
scripts/make-rules/* @openimsdk/openim @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
# test directory
test/mongo @FGadvancer @cubxxw @skiffer-git @kubbot
test/mysql @FGadvancer @cubxxw @skiffer-git @kubbot
test/mongo @FGadvancer @cubxxw @skiffer-git @openimsdk/bot
test/mysql @FGadvancer @cubxxw @skiffer-git @openimsdk/bot

@ -250,7 +250,6 @@ func (m *MessageApi) BatchSendMsg(c *gin.Context) {
return
}
var recvIDs []string
var err error
if req.IsSendAll {

@ -16,6 +16,7 @@ package msggateway
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/cache"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"

@ -18,12 +18,12 @@ import (
"context"
)
// OfflinePusher Offline Pusher
// OfflinePusher Offline Pusher.
type OfflinePusher interface {
Push(ctx context.Context, userIDs []string, title, content string, opts *Opts) error
}
// Opts opts
// Opts opts.
type Opts struct {
Signal *Signal
IOSPushSound string
@ -31,7 +31,7 @@ type Opts struct {
Ex string
}
// Signal message id
// Signal message id.
type Signal struct {
ClientMsgID string
}

@ -16,6 +16,7 @@ package msg
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/mcontext"

@ -1,11 +1,12 @@
go build -o api.exe ../cmd/openim-api/main.go
go build -o auth.exe ../cmd/openim-rpc/openim-rpc-auth/main.go
go build -o conversation.exe ../cmd/openim-rpc/openim-rpc-conversation/main.go
go build -o friend.exe ../cmd/openim-rpc/openim-rpc-friend/main.go
go build -o group.exe ../cmd/openim-rpc/openim-rpc-group/main.go
go build -o msg.exe ../cmd/openim-rpc/openim-rpc-msg/main.go
go build -o third.exe ../cmd/openim-rpc/openim-rpc-third/main.go
go build -o user.exe ../cmd/openim-rpc/openim-rpc-user/main.go
go build -o push.exe ../cmd/openim-push/main.go
go build -o msgtransfer.exe ../cmd/openim-msgtransfer/main.go
go build -o msggateway.exe ../cmd/openim-msggateway/main.go
set output_dir=%~dp0..\_output\bin\platforms\windows
go build -o %output_dir%\api.exe ../cmd/openim-api/main.go
go build -o %output_dir%\auth.exe ../cmd/openim-rpc/openim-rpc-auth/main.go
go build -o %output_dir%\conversation.exe ../cmd/openim-rpc/openim-rpc-conversation/main.go
go build -o %output_dir%\friend.exe ../cmd/openim-rpc/openim-rpc-friend/main.go
go build -o %output_dir%\group.exe ../cmd/openim-rpc/openim-rpc-group/main.go
go build -o %output_dir%\msg.exe ../cmd/openim-rpc/openim-rpc-msg/main.go
go build -o %output_dir%\third.exe ../cmd/openim-rpc/openim-rpc-third/main.go
go build -o %output_dir%\user.exe ../cmd/openim-rpc/openim-rpc-user/main.go
go build -o %output_dir%\push.exe ../cmd/openim-push/main.go
go build -o %output_dir%\msgtransfer.exe ../cmd/openim-msgtransfer/main.go
go build -o %output_dir%\msggateway.exe ../cmd/openim-msggateway/main.go

@ -61,7 +61,7 @@ GITLINT_DIR="$OPENIM_ROOT/_output/tools/go-gitlint"
$GITLINT_DIR \
--msg-file=$1 \
--subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|test)(.*)?:\s?.*" \
--subject-regex="^(build|chore|ci|docs|feat|feature|fix|perf|refactor|revert|style|bot|test)(.*)?:\s?.*" \
--subject-maxlen=150 \
--subject-minlen=10 \
--body-regex=".*" \

@ -26,7 +26,7 @@
LC_ALL=C
local_branch="$(git rev-parse --abbrev-ref HEAD)"
valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|bot|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
YELLOW="\e[93m"
GREEN="\e[32m"

@ -36,7 +36,7 @@ echo -e "${YELLOW_PREFIX}=======>SCRIPTS_ROOT=$SCRIPTS_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>OPENIM_ROOT=$OPENIM_ROOT${COLOR_SUFFIX}"
echo -e "${YELLOW_PREFIX}=======>pwd=$PWD${COLOR_SUFFIX}"
bin_dir="$BIN_DIR"
bin_dir="$OPENIM_ROOT/_output/bin"
logs_dir="$OPENIM_ROOT/logs"
sdk_db_dir="$OPENIM_ROOT/sdk/db/"

Loading…
Cancel
Save