From 8cdb805c0bcb3d0b060b5c6521705a434d01e83c Mon Sep 17 00:00:00 2001 From: Zhichang Yu Date: Fri, 6 Dec 2024 22:31:27 +0800 Subject: [PATCH] Fix release.py --- .github/workflows/release.yml | 10 ++++++++++ Dockerfile | 2 +- api/versions.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4454f4807..802337088 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,6 +63,16 @@ jobs: fi fi + - name: Create or overwrite a release + # https://github.com/actions/upload-release-asset has been replaced by https://github.com/softprops/action-gh-release + uses: softprops/action-gh-release@v2 + with: + token: ${{ secrets.MY_GITHUB_TOKEN }} # Use the secret as an environment variable + prerelease: ${{ env.PRERELEASE }} + tag_name: ${{ env.RELEASE_TAG }} + # The body field does not support environment variable substitution directly. + body_path: release_body.md + - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/Dockerfile b/Dockerfile index 1e0c46ce8..03ba0bd70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -120,7 +120,7 @@ RUN --mount=type=cache,id=ragflow_npm,target=/root/.npm,sharing=locked \ COPY .git /ragflow/.git -RUN version_info=$(git describe --tags --match=v* --dirty); \ +RUN version_info=$(git describe --tags --match=v* --dirty --always); \ if [ "$LIGHTEN" == "1" ]; then \ version_info="$version_info slim"; \ else \ diff --git a/api/versions.py b/api/versions.py index 99093492c..73b0a60b1 100644 --- a/api/versions.py +++ b/api/versions.py @@ -43,7 +43,7 @@ def get_closest_tag_and_count(): try: # Get the current commit hash version_info = ( - subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--dirty"]) + subprocess.check_output(["git", "describe", "--tags", "--match=v*", "--dirty", "--always"]) .strip() .decode("utf-8") )