Skip to content

Commit 0f181da

Browse files
committed
Merge tag 'v0.22.0' into upgrade-0.21.1
2 parents 6c58783 + a36a0fe commit 0f181da

File tree

874 files changed

+45475
-27834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

874 files changed

+45475
-27834
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ concurrency:
1616

1717
jobs:
1818
release:
19-
runs-on: [ "self-hosted", "overseas" ]
19+
runs-on: [ "self-hosted", "ragflow-test" ]
2020
steps:
2121
- name: Ensure workspace ownership
22-
run: echo "chown -R $USER $GITHUB_WORKSPACE" && sudo chown -R $USER $GITHUB_WORKSPACE
22+
run: echo "chown -R ${USER} ${GITHUB_WORKSPACE}" && sudo chown -R ${USER} ${GITHUB_WORKSPACE}
2323

2424
# https://github.com/actions/checkout/blob/v3/README.md
2525
- name: Check out code
@@ -31,37 +31,37 @@ jobs:
3131

3232
- name: Prepare release body
3333
run: |
34-
if [[ $GITHUB_EVENT_NAME == 'create' ]]; then
34+
if [[ ${GITHUB_EVENT_NAME} == "create" ]]; then
3535
RELEASE_TAG=${GITHUB_REF#refs/tags/}
36-
if [[ $RELEASE_TAG == 'nightly' ]]; then
36+
if [[ ${RELEASE_TAG} == "nightly" ]]; then
3737
PRERELEASE=true
3838
else
3939
PRERELEASE=false
4040
fi
41-
echo "Workflow triggered by create tag: $RELEASE_TAG"
41+
echo "Workflow triggered by create tag: ${RELEASE_TAG}"
4242
else
4343
RELEASE_TAG=nightly
4444
PRERELEASE=true
4545
echo "Workflow triggered by schedule"
4646
fi
47-
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
48-
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
47+
echo "RELEASE_TAG=${RELEASE_TAG}" >> ${GITHUB_ENV}
48+
echo "PRERELEASE=${PRERELEASE}" >> ${GITHUB_ENV}
4949
RELEASE_DATETIME=$(date --rfc-3339=seconds)
50-
echo Release $RELEASE_TAG created from $GITHUB_SHA at $RELEASE_DATETIME > release_body.md
50+
echo Release ${RELEASE_TAG} created from ${GITHUB_SHA} at ${RELEASE_DATETIME} > release_body.md
5151
5252
- name: Move the existing mutable tag
5353
# https://github.com/softprops/action-gh-release/issues/171
5454
run: |
5555
git fetch --tags
56-
if [[ $GITHUB_EVENT_NAME == 'schedule' ]]; then
56+
if [[ ${GITHUB_EVENT_NAME} == "schedule" ]]; then
5757
# Determine if a given tag exists and matches a specific Git commit.
5858
# actions/checkout@v4 fetch-tags doesn't work when triggered by schedule
59-
if [ "$(git rev-parse -q --verify "refs/tags/$RELEASE_TAG")" = "$GITHUB_SHA" ]; then
60-
echo "mutable tag $RELEASE_TAG exists and matches $GITHUB_SHA"
59+
if [ "$(git rev-parse -q --verify "refs/tags/${RELEASE_TAG}")" = "${GITHUB_SHA}" ]; then
60+
echo "mutable tag ${RELEASE_TAG} exists and matches ${GITHUB_SHA}"
6161
else
62-
git tag -f $RELEASE_TAG $GITHUB_SHA
63-
git push -f origin $RELEASE_TAG:refs/tags/$RELEASE_TAG
64-
echo "created/moved mutable tag $RELEASE_TAG to $GITHUB_SHA"
62+
git tag -f ${RELEASE_TAG} ${GITHUB_SHA}
63+
git push -f origin ${RELEASE_TAG}:refs/tags/${RELEASE_TAG}
64+
echo "created/moved mutable tag ${RELEASE_TAG} to ${GITHUB_SHA}"
6565
fi
6666
fi
6767
@@ -75,62 +75,20 @@ jobs:
7575
# The body field does not support environment variable substitution directly.
7676
body_path: release_body.md
7777

78-
# https://github.com/marketplace/actions/docker-login
79-
- name: Login to Docker Hub
80-
uses: docker/login-action@v3
81-
with:
82-
username: infiniflow
83-
password: ${{ secrets.DOCKERHUB_TOKEN }}
84-
85-
# https://github.com/marketplace/actions/build-and-push-docker-images
86-
- name: Build and push full image
87-
uses: docker/build-push-action@v6
88-
with:
89-
context: .
90-
push: true
91-
tags: |
92-
infiniflow/ragflow:${{ env.RELEASE_TAG }}
93-
infiniflow/ragflow:latest-full
94-
file: Dockerfile
95-
platforms: linux/amd64
96-
97-
# https://github.com/marketplace/actions/build-and-push-docker-images
98-
- name: Build and push slim image
99-
uses: docker/build-push-action@v6
100-
with:
101-
context: .
102-
push: true
103-
tags: |
104-
infiniflow/ragflow:${{ env.RELEASE_TAG }}-slim
105-
infiniflow/ragflow:latest-slim
106-
file: Dockerfile
107-
build-args: LIGHTEN=1
108-
platforms: linux/amd64
109-
110-
- name: Build ragflow-sdk
78+
- name: Build and push ragflow-sdk
11179
if: startsWith(github.ref, 'refs/tags/v')
11280
run: |
113-
cd sdk/python && \
114-
uv build
81+
cd sdk/python && uv build && uv publish --token ${{ secrets.PYPI_API_TOKEN }}
11582
116-
- name: Publish package distributions to PyPI
117-
if: startsWith(github.ref, 'refs/tags/v')
118-
uses: pypa/gh-action-pypi-publish@release/v1
119-
with:
120-
packages-dir: sdk/python/dist/
121-
password: ${{ secrets.PYPI_API_TOKEN }}
122-
verbose: true
123-
124-
- name: Build ragflow-cli
83+
- name: Build and push ragflow-cli
12584
if: startsWith(github.ref, 'refs/tags/v')
12685
run: |
127-
cd admin/client && \
128-
uv build
86+
cd admin/client && uv build && uv publish --token ${{ secrets.PYPI_API_TOKEN }}
12987
130-
- name: Publish client package distributions to PyPI
131-
if: startsWith(github.ref, 'refs/tags/v')
132-
uses: pypa/gh-action-pypi-publish@release/v1
133-
with:
134-
packages-dir: admin/client/dist/
135-
password: ${{ secrets.PYPI_API_TOKEN }}
136-
verbose: true
88+
- name: Build and push image
89+
run: |
90+
sudo docker login --username infiniflow --password-stdin <<< ${{ secrets.DOCKERHUB_TOKEN }}
91+
sudo docker build --build-arg NEED_MIRROR=1 -t infiniflow/ragflow:${RELEASE_TAG} -f Dockerfile .
92+
sudo docker tag infiniflow/ragflow:${RELEASE_TAG} infiniflow/ragflow:latest
93+
sudo docker push infiniflow/ragflow:${RELEASE_TAG}
94+
sudo docker push infiniflow/ragflow:latest

0 commit comments

Comments
 (0)