-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2873 from openimsdk/cherry-pick-7f44319
deps: Merge #2712 #2794 #2811 #2813 #2815 #2822 #2825 #2826 #2836 #2837 #2838 #2842 #2844 #2850 #2851 #2856 #2858 #2861 #2862 #2866 #2869 #2871 PRs into pre-release-v3.8.2
- Loading branch information
Showing
58 changed files
with
936 additions
and
816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Release Changelog | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Go Changelog Generator | ||
run: | | ||
# Run the Go changelog generator, passing the release tag if available | ||
if [ "${{ github.event.release.tag_name }}" = "latest" ]; then | ||
go run tools/changelog/changelog.go > "${{ github.event.release.tag_name }}-changelog.md" | ||
else | ||
go run tools/changelog/changelog.go "${{ github.event.release.tag_name }}" > "${{ github.event.release.tag_name }}-changelog.md" | ||
fi | ||
- name: Handle changelog files | ||
run: | | ||
# Ensure that the CHANGELOG directory exists | ||
mkdir -p CHANGELOG | ||
# Extract Major.Minor version by removing the 'v' prefix from the tag name | ||
TAG_NAME=${{ github.event.release.tag_name }} | ||
CHANGELOG_VERSION_NUMBER=$(echo "$TAG_NAME" | sed 's/^v//' | grep -oP '^\d+\.\d+') | ||
# Define the new changelog file path | ||
CHANGELOG_FILENAME="CHANGELOG-$CHANGELOG_VERSION_NUMBER.md" | ||
CHANGELOG_PATH="CHANGELOG/$CHANGELOG_FILENAME" | ||
# Check if the changelog file for the current release already exists | ||
if [ -f "$CHANGELOG_PATH" ]; then | ||
# If the file exists, append the new changelog to the existing one | ||
cat "$CHANGELOG_PATH" >> "${TAG_NAME}-changelog.md" | ||
# Overwrite the existing changelog with the updated content | ||
mv "${TAG_NAME}-changelog.md" "$CHANGELOG_PATH" | ||
else | ||
# If the changelog file doesn't exist, rename the temp changelog file to the new changelog file | ||
mv "${TAG_NAME}-changelog.md" "$CHANGELOG_PATH" | ||
# Ensure that README.md exists | ||
if [ ! -f "CHANGELOG/README.md" ]; then | ||
echo -e "# CHANGELOGs\n\n" > CHANGELOG/README.md | ||
fi | ||
# Add the new changelog entry at the top of the README.md | ||
if ! grep -q "\[$CHANGELOG_FILENAME\]" CHANGELOG/README.md; then | ||
sed -i "3i- [$CHANGELOG_FILENAME](./$CHANGELOG_FILENAME)" CHANGELOG/README.md | ||
# Remove the extra newline character added by sed | ||
# sed -i '4d' CHANGELOG/README.md | ||
fi | ||
fi | ||
- name: Clean up | ||
run: | | ||
# Remove any temporary files that were created during the process | ||
rm -f "${{ github.event.release.tag_name }}-changelog.md" | ||
- name: Create Pull Request | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
commit-message: "Update CHANGELOG for release ${{ github.event.release.tag_name }}" | ||
title: "Update CHANGELOG for release ${{ github.event.release.tag_name }}" | ||
body: "This PR updates the CHANGELOG files for release ${{ github.event.release.tag_name }}" | ||
branch: changelog-${{ github.event.release.tag_name }} | ||
base: main | ||
delete-branch: true | ||
labels: changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Update Version File on Release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
env: | ||
TAG_VERSION: ${{ github.event.release.tag_name }} | ||
steps: | ||
# Step 1: Checkout the original repository's code | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Step 2: Set up Git with official account | ||
- name: Set up Git | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
# Step 3: Check and delete existing tag | ||
- name: Check and delete existing tag | ||
run: | | ||
if git rev-parse ${{ env.TAG_VERSION }} >/dev/null 2>&1; then | ||
git tag -d ${{ env.TAG_VERSION }} | ||
git push --delete origin ${{ env.TAG_VERSION }} | ||
fi | ||
# Step 4: Update version file | ||
- name: Update version file | ||
run: | | ||
echo "${{ env.TAG_VERSION }}" > version/version | ||
# Step 5: Commit and push changes | ||
- name: Commit and push changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git add version/version | ||
git commit -m "Update version to ${{ env.TAG_VERSION }}" | ||
git push origin HEAD:${{ github.ref }} | ||
# Step 6: Create and push tag | ||
- name: Create and push tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git tag ${{ env.TAG_VERSION }} | ||
git push origin ${{ env.TAG_VERSION }} | ||
# Step 7: Find and Publish Draft Release | ||
- name: Find and Publish Draft Release | ||
uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
// Get the list of releases | ||
const releases = await github.rest.repos.listReleases({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo | ||
}); | ||
// Find the draft release where the title and tag_name are the same | ||
const draftRelease = releases.data.find(release => | ||
release.draft && release.name === release.tag_name | ||
); | ||
if (draftRelease) { | ||
// Publish the draft release using the release_id | ||
await github.rest.repos.updateRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
release_id: draftRelease.id, // Use release_id | ||
draft: false | ||
}); | ||
core.info(`Draft Release ${draftRelease.tag_name} published successfully.`); | ||
} else { | ||
core.info("No matching draft release found."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Use Go 1.21 Alpine as the base image for building the application | ||
FROM golang:1.21-alpine AS builder | ||
# Use Go 1.22 Alpine as the base image for building the application | ||
FROM golang:1.22-alpine AS builder | ||
|
||
# Define the base directory for the application as an environment variable | ||
ENV SERVER_DIR=/openim-server | ||
|
@@ -22,7 +22,7 @@ RUN go install github.com/magefile/[email protected] | |
RUN mage build | ||
|
||
# Using Alpine Linux with Go environment for the final image | ||
FROM golang:1.21-alpine | ||
FROM golang:1.22-alpine | ||
|
||
# Install necessary packages, such as bash | ||
RUN apk add --no-cache bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,3 @@ longConnSvr: | |
websocketMaxMsgLen: 4096 | ||
# WebSocket connection handshake timeout in seconds | ||
websocketTimeout: 10 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.