Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/auto-assign-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ on:
jobs:
assign-issue:
if: |
contains(github.event.comment.body, '/assign') || contains(github.event.comment.body, '/accept') &&
!contains(github.event.comment.user.login, 'openim-robot')
(contains(github.event.comment.body, '/assign') || contains(github.event.comment.body, '/accept')) &&
github.event.comment.user.login != 'openim-robot'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Assign the issue
run: |
export LETASE_MILESTONES=$(curl 'https://api.github.com/repos/$OWNER/$PEPO/milestones' | jq -r 'last(.[]).title')
export LATEST_MILESTONE=$(curl "https://api.github.com/repos/$OWNER/$REPO/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 "accepted"
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!"
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 [$LATEST_MILESTONE](https://github.com/$OWNER/$REPO/milestones), We are looking forward to your PR!"

# gh issue edit ${{ github.event.issue.number }} --milestone "$LETASE_MILESTONES"
# gh issue edit ${{ github.event.issue.number }} --milestone "$LATEST_MILESTONE"
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
ISSUE: ${{ github.event.issue.html_url }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-invite-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
issues: write
steps:
- name: Invite user to join OpenIM Community
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-invite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
issues: write
steps:
- name: Invite user to join our group
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v5
with:
token: ${{ secrets.BOT_GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,39 @@ on:
required: true
default: "v3.8.0"

env:
GO_VERSION: "1.22"

jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.8.0
uses: docker/setup-buildx-action@v4

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

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

- name: Log in to Aliyun Container Registry
uses: docker/login-action@v3.3.0
uses: docker/login-action@v4
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIREGISTRY_USERNAME }}
password: ${{ secrets.ALIREGISTRY_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.6.0
uses: docker/metadata-action@v6
with:
images: |
openim/openim-chat
Expand All @@ -70,7 +67,7 @@ jobs:
type=raw,value=${{ github.event.inputs.tag }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Run Go Changelog Generator
run: |
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
rm -f "${{ github.event.release.tag_name }}-changelog.md"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.5
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update CHANGELOG for release ${{ github.event.release.tag_name }}"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/chat-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ jobs:
arch: [amd64]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v6
with:
go-version: "1.22"
go-version: stable

- name: init
run: sudo bash bootstrap.sh
timeout-minutes: 20

- name: Checkout chat repository
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
repository: "openimsdk/open-im-server"
path: "server-repo"
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/check-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@ on:
- "**/*.yaml"
- "CONTRIBUTORS"
- "CHANGELOG/**"
env:
# Common versions
GO_VERSION: "1.20"

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

- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
go-version: stable
cache: true

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

- name: Run Cover
run: make cover
run: go test ./... -coverprofile=coverage.txt -covermode=atomic
continue-on-error: true

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v7
with:
files: coverage.txt
4 changes: 2 additions & 2 deletions .github/workflows/cla-assistant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
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.4.0
uses: contributor-assistant/github-action@v2.6.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand All @@ -37,4 +37,4 @@ jobs:
custom-pr-sign-comment: 'I have read the CLA Document and I hereby sign the CLA'
custom-allsigned-prcomment: '馃 All Contributors have signed the [CLA](https://github.com/OpenIM-Robot/cla/blob/main/README.md).<br> The signed information is recorded [**here**](https://github.com/OpenIM-Robot/cla/blob/main/signatures/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
#use-dco-flag: true - If you are using DCO instead of CLA
13 changes: 6 additions & 7 deletions .github/workflows/cleanup-after-milestone-prs-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.2.0
uses: actions/checkout@v7

- name: Get the PR title and extract PR numbers
id: extract_pr_numbers
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
# Get the PR title
PR_TITLE="${{ github.event.pull_request.title }}"

echo "PR Title: $PR_TITLE"

# Extract PR numbers from the title
Expand Down Expand Up @@ -57,9 +56,9 @@ jobs:

- name: Delete branch after PR close
if: steps.extract_pr_numbers.outputs.proceed == 'true' || contains(github.event.pull_request.labels.*.name, 'milestone-merge')
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
echo "Branch to delete: $BRANCH_NAME"
git push origin --delete "$BRANCH_NAME"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down Expand Up @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/comment-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
EXCLUDE_FILES: "*.md *.txt *.html *.css *.min.js *.mdx"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Search for Non-English comments
run: |
Expand Down Expand Up @@ -48,4 +48,4 @@ jobs:
exit 1 # terminate the workflow
else
echo "No Non_English comments found."
fi
fi
51 changes: 15 additions & 36 deletions .github/workflows/docker-build-and-release-services-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.8.0
uses: docker/setup-buildx-action@v4

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

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

- name: Log in to Aliyun Container Registry
uses: docker/login-action@v3.3.0
uses: docker/login-action@v4
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIREGISTRY_USERNAME }}
password: ${{ secrets.ALIREGISTRY_TOKEN }}

- name: Extract metadata for Docker (tags, labels)
id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
with:
tags: |
type=ref,event=tag
Expand All @@ -58,33 +58,12 @@ jobs:
type=raw,value=${{ github.event.inputs.tag }}

- name: Build and push Docker images
run: |
IMG_DIR="build/images"
for dir in "$IMG_DIR"/*/; do
# Find Dockerfile or *.dockerfile in a case-insensitive manner
dockerfile=$(find "$dir" -maxdepth 1 -type f \( -iname 'dockerfile' -o -iname '*.dockerfile' \) | head -n 1)

if [ -n "$dockerfile" ] && [ -f "$dockerfile" ]; then
IMAGE_NAME=$(basename "$dir")
echo "Building Docker image for $IMAGE_NAME with tags:"

# Initialize tag arguments
tag_args=()

# Read each tag and append --tag arguments
while IFS= read -r tag; do
tag_args+=(--tag "${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:$tag")
tag_args+=(--tag "ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:$tag")
tag_args+=(--tag "registry.cn-hangzhou.aliyuncs.com/openimsdk/$IMAGE_NAME:$tag")
done <<< "${{ steps.meta.outputs.tags }}"

# Build and push the Docker image with all tags
docker buildx build --platform linux/amd64,linux/arm64 \
--file "$dockerfile" \
"${tag_args[@]}" \
--push \
"."
else
echo "No valid Dockerfile found in $dir"
fi
done
env:
PUSH: "true"
RELEASE: "true"
IMAGE_TAGS: ${{ steps.meta.outputs.tags }}
IMAGE_REGISTRIES: |
${{ secrets.DOCKER_USERNAME }}
ghcr.io/${{ github.repository_owner }}
registry.cn-hangzhou.aliyuncs.com/openimsdk
run: build/build.sh
12 changes: 7 additions & 5 deletions .github/workflows/gosec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ name: OpenIM Run Gosec
# https://github.com/securego/gosec/
on:
push:
branches: "*"
branches:
- "*"
pull_request:
branches: "*"
branches:
- "*"
paths-ignore:
- '*.md'
- '*.yml'
Expand All @@ -23,9 +25,9 @@ jobs:
GO111MODULE: on
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v7
- name: Run Gosec Security Scanner
uses: securego/gosec@master
uses: securego/gosec@v2.27.1
with:
args: ./...
continue-on-error: true
continue-on-error: true
2 changes: 1 addition & 1 deletion .github/workflows/help-comment-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ github.event.issue.number }}
token: ${{ secrets.BOT_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-from-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
touch ${{ env.TEMP_DIR }}/created_pr_number.txt

- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
Expand Down
Loading
Loading