feat: set github hub

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim) 2023-08-02 12:35:45 +08:00
parent 07d01d5cc6
commit 62f599317a
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE
7 changed files with 98 additions and 80 deletions

View File

@ -9,3 +9,37 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "daily" interval: "daily"
time: "08:00"
labels:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"
groups:
gomod-deps:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"
groups:
github-actions:
patterns:
- "*"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
labels:
- "dependencies"
commit-message:
prefix: "feat"
include: "scope"

View File

@ -18,30 +18,21 @@ on:
pull_request: pull_request:
# types: # types:
# - closed # - closed
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs: jobs:
create-pr: create-pr:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'main' if: github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true
steps: steps:
- name: Check out code - name: Check out code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 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 - name: Create PR to release branch
run: | run: |
ISSUEID=$(gh pr view ${{ github.event.pull_request.number }} --repo $OWNER/$REPO | grep -oP 'Fixes #\K\d+') ISSUEID=$(gh pr view ${{ github.event.pull_request.number }} --repo $OWNER/$REPO | grep -oP 'Fixes #\K\d+')
@ -56,10 +47,9 @@ jobs:
gh pr edit ${{ github.event.pull_request.number }} --repo $OWNER/$REPO --add-label "$LABELS" --add-assignee "$ASSIGNEES" --milestone "$MILESTONE" 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 checkout -b bot/merge-to-release-$ISSUEID
git push origin 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 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" # 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 continue-on-error: true
env: env:

View File

@ -114,7 +114,7 @@ linters-settings:
max-blank-identifiers: 2 max-blank-identifiers: 2
dupl: dupl:
# tokens count to trigger issue, 150 by default # tokens count to trigger issue, 150 by default
threshold: 100 threshold: 200
errcheck: errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`; # report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default. # default is false: such cases aren't reported by default.

View File

@ -447,8 +447,8 @@ milestones:
# Repository for the milestone # Repository for the milestone
# Default is extracted from the origin remote URL # Default is extracted from the origin remote URL
repo: repo:
owner: user owner: OpenIMSDK
name: repo name: Open-IM-Server
# Whether to close the milestone # Whether to close the milestone
close: true close: true
@ -479,6 +479,9 @@ checksum:
algorithm: sha256 algorithm: sha256
release: release:
prerelease: auto
footer: | footer: |
## Welcome to the {{ .Tag }} release of [chat](https://github.com/OpenIMSDK/chat)!🎉🎉! ## Welcome to the {{ .Tag }} release of [chat](https://github.com/OpenIMSDK/chat)!🎉🎉!
@ -493,7 +496,7 @@ release:
This release is only possible thanks to **all** the support of some **awesome people**! This release is only possible thanks to **all** the support of some **awesome people**!
https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/version.md If you wish to use mirroring, read OpenIM's [image management policy](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md)
**Want to be one of them 😘?** **Want to be one of them 😘?**

View File

@ -1,10 +1,6 @@
# Build Stage # Build Stage
FROM golang:1.20 AS builder FROM golang:1.20 AS builder
LABEL org.opencontainers.image.source=https://github.com/OpenIMSDK/Open-IM-Server
LABEL org.opencontainers.image.description="OpenIM Server image"
LABEL org.opencontainers.image.licenses="Apache 2.0"
# Set go mod installation source and proxy # Set go mod installation source and proxy
ARG GO111MODULE=on ARG GO111MODULE=on
ARG GOPROXY=https://goproxy.cn,direct ARG GOPROXY=https://goproxy.cn,direct
@ -19,14 +15,7 @@ ADD . .
RUN /bin/sh -c "make build" RUN /bin/sh -c "make build"
# Production Stage FROM ghcr.io/openim-sigs/openim-bash-image:latest
FROM alpine
RUN echo "https://mirrors.aliyun.com/alpine/v3.4/main" > /etc/apk/repositories && \
apk --no-cache add tzdata ca-certificates bash
# Set directory to map logs, config files, scripts, and SDK
VOLUME ["/Open-IM-Server/logs", "/Open-IM-Server/config", "/Open-IM-Server/scripts", "/Open-IM-Server/db/sdk"]
# Copy scripts and binary files to the production image # Copy scripts and binary files to the production image
COPY --from=builder /Open-IM-Server/scripts /Open-IM-Server/scripts COPY --from=builder /Open-IM-Server/scripts /Open-IM-Server/scripts

View File

@ -103,11 +103,10 @@ services:
image: ghcr.io/openimsdk/openim-server:main image: ghcr.io/openimsdk/openim-server:main
container_name: openim-server container_name: openim-server
volumes: volumes:
- ./logs:/Open-IM-Server/logs - ./logs:/openim/openim-server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml - ./config/config.yaml:/openim/openim-server/config/config.yaml
- ./config/notification.yaml:/Open-IM-Server/config/notification.yaml - ./config/notification.yaml:/openim/openim-server/config/notification.yaml
- ${DATA_DIR}/db/sdk:/Open-IM-Server/db/sdk - ./scripts:/openim/openim-server/scripts
- ./scripts:/Open-IM-Server/scripts
restart: always restart: always
depends_on: depends_on:
- zookeeper - zookeeper

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
function style-info() {
COLOR_SUFFIX="\033[0m" # End all colors and special effects COLOR_SUFFIX="\033[0m" # End all colors and special effects
BLACK_PREFIX="\033[30m" # Black prefix BLACK_PREFIX="\033[30m" # Black prefix
@ -60,3 +60,6 @@ BACKGROUND_LIGHT_BLUE="\033[104m" # Light blue background
BACKGROUND_LIGHT_PURPLE="\033[105m" # Light purple background BACKGROUND_LIGHT_PURPLE="\033[105m" # Light purple background
BACKGROUND_LIGHT_SKY_BLUE="\033[106m" # Light sky blue background BACKGROUND_LIGHT_SKY_BLUE="\033[106m" # Light sky blue background
BACKGROUND_LIGHT_WHITE="\033[107m" # Light white background BACKGROUND_LIGHT_WHITE="\033[107m" # Light white background
}
style-info