Skip to content

Commit

Permalink
feat: add go relase (#63)
Browse files Browse the repository at this point in the history
* feat: add go relase

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add go relase

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add go relase

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add go relase

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add go relase

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add test

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add test

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add test

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add images address

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add images address

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add images address

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

* feat: add multi-architecture mirroring

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>

---------

Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>
  • Loading branch information
cubxxw authored Jul 28, 2023
1 parent 1939145 commit 536b485
Show file tree
Hide file tree
Showing 32 changed files with 2,455 additions and 50 deletions.
31 changes: 31 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Ignore files and directories starting with a dot

# Ignore specific files
.dockerignore

# Ignore build artifacts
_output/
logs/

# Ignore non-essential documentation
README.md
README-zh_CN.md
CONTRIBUTING.md
CHANGELOG/
# LICENSE

# Ignore testing and linting configuration
.golangci.yml

# Ignore deployment-related files
docker-compose.yaml
deployments/

# Ignore assets
assets/

# Ignore components
components/

# Ignore tools and scripts
.github/
23 changes: 23 additions & 0 deletions .github/.codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright © 2023 OpenIM. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

coverage:
status:
project:
default: false # disable the default status that measures entire project
pkg: # declare a new status context "pkg"
paths:
- pkg/* # only include coverage in "pkg/" folder
informational: true # Always pass check
patch: off # disable the commit only checks
43 changes: 43 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright © 2023 OpenIM. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Refer to Kubernetes for size/* Settings
# https://github.com/Kubernetes/Kubernetes
XS:
name: size/XS
lines: 0
color: 3CBF00
S:
name: size/S
lines: 10
color: 5D9801
M:
name: size/M
lines: 30
color: 7F7203
L:
name: size/L
lines: 100
color: A14C05
XL:
name: size/XL
lines: 500
color: C32607
XXL:
name: size/XXL
lines: 1000
color: E50009
comment: |
# Whoa! Easy there, Partner!
This PR is too big. Please break it up into smaller PRs.
21 changes: 21 additions & 0 deletions .github/weekly-digest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright © 2023 OpenIM. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# https://github.com/apps/weekly-digest/installations/new
publishDay: sun
canPublishIssues: true
canPublishPullRequests: true
canPublishContributors: true
canPublishStargazers: true
canPublishCommits: true
43 changes: 43 additions & 0 deletions .github/workflows/auto-assign-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright © 2023 OpenIM open source community. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

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 }}
103 changes: 103 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Copyright © 2023 OpenIM open source community. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Publish Docker image

on:
push:
branches:
- main
tags:
- v*
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

# build chat
- name: Build chat
run: |
sudo make build
cd scripts
sudo ./build_all_service.sh
# docker.io/openim/openim-chat:latest
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: openim/openim-chat

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat:latest
- name: Extract metadata (tags, labels) for Docker
id: meta2
uses: docker/[email protected]
with:
images: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-chat

- name: Log in to AliYun Docker Hub
uses: docker/login-action@v2
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIREGISTRY_USERNAME }}
password: ${{ secrets.ALIREGISTRY_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta2.outputs.tags }}
labels: ${{ steps.meta2.outputs.labels }}

# ghcr.io/openimsdk/openim-chat:latest
- name: Extract metadata (tags, labels) for Docker
id: meta3
uses: docker/[email protected]
with:
images: ghcr.io/openimsdk/openim-chat

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta3.outputs.tags }}
labels: ${{ steps.meta3.outputs.labels }}

59 changes: 59 additions & 0 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright © 2023 OpenIM open source community. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

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"

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 }}

- name: Install Dependencies
run: sudo apt update && sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev

- name: Run Cover
run: make cover
continue-on-error: true

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
62 changes: 62 additions & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright © 2023 OpenIM open source community. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

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/[email protected]
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
Loading

0 comments on commit 536b485

Please sign in to comment.