mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 17:15:58 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6eb6ac1c57 | |||
| 2804d90020 | |||
| 4ca3f2dc0c | |||
| b92c5ab821 | |||
| 9c4b6e50ef | |||
| 54e189d80f | |||
| 1b6d70e4a7 | |||
| 4c9cf55867 |
@@ -15,12 +15,33 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
# submodules: "recursive"
|
||||||
|
|
||||||
|
- name: Safe submodule initialization
|
||||||
|
run: |
|
||||||
|
echo "Checking for submodules..."
|
||||||
|
if [ -f .gitmodules ]; then
|
||||||
|
if [ -s .gitmodules ]; then
|
||||||
|
echo "Initializing submodules..."
|
||||||
|
if git submodule sync --recursive 2>/dev/null; then
|
||||||
|
git submodule update --init --force --recursive || {
|
||||||
|
echo "Warning: Some submodules failed to initialize, continuing anyway..."
|
||||||
|
}
|
||||||
|
else
|
||||||
|
echo "Warning: Submodule sync failed, continuing without submodules..."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo ".gitmodules exists but is empty, skipping submodule initialization"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No .gitmodules file found, no submodules to initialize"
|
||||||
|
fi
|
||||||
|
|
||||||
# Step 2: Set up Git with official account
|
# Step 2: Set up Git with official account
|
||||||
- name: Set up Git
|
- name: Set up Git
|
||||||
run: |
|
run: |
|
||||||
git config user.name "github-actions[bot]"
|
git config --global user.name "github-actions[bot]"
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
# Step 3: Check and delete existing tag
|
# Step 3: Check and delete existing tag
|
||||||
- name: Check and delete existing tag
|
- name: Check and delete existing tag
|
||||||
@@ -33,7 +54,8 @@ jobs:
|
|||||||
# Step 4: Update version file
|
# Step 4: Update version file
|
||||||
- name: Update version file
|
- name: Update version file
|
||||||
run: |
|
run: |
|
||||||
echo "${{ env.TAG_VERSION }}" > version/version
|
mkdir -p version
|
||||||
|
echo -n "${{ env.TAG_VERSION }}" > version/version
|
||||||
|
|
||||||
# Step 5: Commit and push changes
|
# Step 5: Commit and push changes
|
||||||
- name: Commit and push changes
|
- name: Commit and push changes
|
||||||
@@ -42,43 +64,56 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git add version/version
|
git add version/version
|
||||||
git commit -m "Update version to ${{ env.TAG_VERSION }}"
|
git commit -m "Update version to ${{ env.TAG_VERSION }}"
|
||||||
git push origin HEAD:${{ github.ref }}
|
|
||||||
|
|
||||||
# Step 6: Create and push tag
|
# Step 6: Update tag
|
||||||
- name: Create and push tag
|
- name: Update tag
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
run: |
|
||||||
git tag ${{ env.TAG_VERSION }}
|
git tag -fa ${{ env.TAG_VERSION }} -m "Update version to ${{ env.TAG_VERSION }}"
|
||||||
git push origin ${{ env.TAG_VERSION }}
|
git push origin ${{ env.TAG_VERSION }} --force
|
||||||
|
|
||||||
# Step 7: Find and Publish Draft Release
|
# Step 7: Find and Publish Draft Release
|
||||||
- name: Find and Publish Draft Release
|
- name: Find and Publish Draft Release
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
// Get the list of releases
|
const { owner, repo } = context.repo;
|
||||||
const releases = await github.rest.repos.listReleases({
|
const tagName = process.env.TAG_VERSION;
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo
|
|
||||||
});
|
|
||||||
|
|
||||||
// Find the draft release where the title and tag_name are the same
|
try {
|
||||||
const draftRelease = releases.data.find(release =>
|
let release;
|
||||||
release.draft && release.name === release.tag_name
|
try {
|
||||||
);
|
const response = await github.rest.repos.getReleaseByTag({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
tag: tagName
|
||||||
|
});
|
||||||
|
release = response.data;
|
||||||
|
} catch (tagError) {
|
||||||
|
core.info(`Release not found by tag, searching all releases...`);
|
||||||
|
const releases = await github.rest.repos.listReleases({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
per_page: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
release = releases.data.find(r => r.draft && r.tag_name === tagName);
|
||||||
|
if (!release) {
|
||||||
|
throw new Error(`No release found with tag ${tagName}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (draftRelease) {
|
|
||||||
// Publish the draft release using the release_id
|
|
||||||
await github.rest.repos.updateRelease({
|
await github.rest.repos.updateRelease({
|
||||||
owner: context.repo.owner,
|
owner,
|
||||||
repo: context.repo.repo,
|
repo,
|
||||||
release_id: draftRelease.id, // Use release_id
|
release_id: release.id,
|
||||||
draft: false
|
draft: false,
|
||||||
|
prerelease: release.prerelease
|
||||||
});
|
});
|
||||||
|
|
||||||
core.info(`Draft Release ${draftRelease.tag_name} published successfully.`);
|
const status = release.draft ? "was draft" : "was already published";
|
||||||
} else {
|
core.info(`Release ${tagName} ensured to be published (${status}).`);
|
||||||
core.info("No matching draft release found.");
|
|
||||||
|
} catch (error) {
|
||||||
|
core.warning(`Could not find or update release for tag ${tagName}: ${error.message}`);
|
||||||
}
|
}
|
||||||
@@ -103,22 +103,24 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg
|
|||||||
}
|
}
|
||||||
userClient := rpcli.NewUserClient(userConn)
|
userClient := rpcli.NewUserClient(userConn)
|
||||||
|
|
||||||
|
database := controller.NewFriendDatabase(
|
||||||
|
friendMongoDB,
|
||||||
|
friendRequestMongoDB,
|
||||||
|
redis.NewFriendCacheRedis(rdb, &config.LocalCacheConfig, friendMongoDB, redis.GetRocksCacheOptions()),
|
||||||
|
mgocli.GetTx(),
|
||||||
|
)
|
||||||
// Initialize notification sender
|
// Initialize notification sender
|
||||||
notificationSender := NewFriendNotificationSender(
|
notificationSender := NewFriendNotificationSender(
|
||||||
&config.NotificationConfig,
|
&config.NotificationConfig,
|
||||||
rpcli.NewMsgClient(msgConn),
|
rpcli.NewMsgClient(msgConn),
|
||||||
WithRpcFunc(userClient.GetUsersInfo),
|
WithRpcFunc(userClient.GetUsersInfo),
|
||||||
|
WithFriendDB(database),
|
||||||
)
|
)
|
||||||
localcache.InitLocalCache(&config.LocalCacheConfig)
|
localcache.InitLocalCache(&config.LocalCacheConfig)
|
||||||
|
|
||||||
// Register Friend server with refactored MongoDB and Redis integrations
|
// Register Friend server with refactored MongoDB and Redis integrations
|
||||||
relation.RegisterFriendServer(server, &friendServer{
|
relation.RegisterFriendServer(server, &friendServer{
|
||||||
db: controller.NewFriendDatabase(
|
db: database,
|
||||||
friendMongoDB,
|
|
||||||
friendRequestMongoDB,
|
|
||||||
redis.NewFriendCacheRedis(rdb, &config.LocalCacheConfig, friendMongoDB, redis.GetRocksCacheOptions()),
|
|
||||||
mgocli.GetTx(),
|
|
||||||
),
|
|
||||||
blackDatabase: controller.NewBlackDatabase(
|
blackDatabase: controller.NewBlackDatabase(
|
||||||
blackMongoDB,
|
blackMongoDB,
|
||||||
redis.NewBlackCacheRedis(rdb, &config.LocalCacheConfig, blackMongoDB, redis.GetRocksCacheOptions()),
|
redis.NewBlackCacheRedis(rdb, &config.LocalCacheConfig, blackMongoDB, redis.GetRocksCacheOptions()),
|
||||||
|
|||||||
@@ -17,9 +17,12 @@ package third
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/rpcli"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/openimsdk/open-im-server/v3/pkg/rpcli"
|
||||||
|
"github.com/openimsdk/tools/s3/aws"
|
||||||
|
"github.com/openimsdk/tools/s3/disable"
|
||||||
|
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis"
|
||||||
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller"
|
"github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller"
|
||||||
@@ -90,6 +93,10 @@ func Start(ctx context.Context, config *Config, client discovery.SvcDiscoveryReg
|
|||||||
o, err = oss.NewOSS(*config.RpcConfig.Object.Oss.Build())
|
o, err = oss.NewOSS(*config.RpcConfig.Object.Oss.Build())
|
||||||
case "kodo":
|
case "kodo":
|
||||||
o, err = kodo.NewKodo(*config.RpcConfig.Object.Kodo.Build())
|
o, err = kodo.NewKodo(*config.RpcConfig.Object.Kodo.Build())
|
||||||
|
case "aws":
|
||||||
|
o, err = aws.NewAws(*config.RpcConfig.Object.Aws.Build())
|
||||||
|
case "":
|
||||||
|
o = disable.NewDisable()
|
||||||
default:
|
default:
|
||||||
err = fmt.Errorf("invalid object enable: %s", enable)
|
err = fmt.Errorf("invalid object enable: %s", enable)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
v3.8.3
|
v3.8.3-patch.6
|
||||||
+9
-1
@@ -1,6 +1,14 @@
|
|||||||
package version
|
package version
|
||||||
|
|
||||||
import _ "embed"
|
import (
|
||||||
|
_ "embed"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
//go:embed version
|
//go:embed version
|
||||||
var Version string
|
var Version string
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
Version = strings.Trim(Version, "\n")
|
||||||
|
Version = strings.TrimSpace(Version)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user