From 59cad8b36c216eefe80910578f1226da07ce6b44 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 31 Aug 2025 20:55:21 +0300 Subject: [PATCH 1/2] fix: update bump-version.py --- .github/workflows/bump-version.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bump-version.py b/.github/workflows/bump-version.py index 75a5b31..71afd24 100644 --- a/.github/workflows/bump-version.py +++ b/.github/workflows/bump-version.py @@ -2,13 +2,11 @@ import sys sys.path.append("../../") -from clang_tools import release_tag # noqa E402 +from clang_tools import binary_repo, binary_tag # noqa E402 def get_latest_tag() -> str: - response = requests.get( - "https://api.github.com/repos/cpp-linter/clang-tools-static-binaries/releases/latest" - ) + response = requests.get(f"{binary_repo}/releases/latest") return response.json()["tag_name"] @@ -25,7 +23,7 @@ def update_tag(current_tag, latest_tag) -> None: if __name__ == "__main__": latest_tag = get_latest_tag() - current_tag = release_tag + current_tag = binary_tag if latest_tag != current_tag: update_tag(current_tag, latest_tag) From 31cea82d6e28182fdeb3610291c713c0bd6e8c7d Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 31 Aug 2025 21:00:01 +0300 Subject: [PATCH 2/2] fix: remove bump version --- .github/workflows/bump-version.py | 31 ------------------ .github/workflows/bump-version.yml | 50 ------------------------------ 2 files changed, 81 deletions(-) delete mode 100644 .github/workflows/bump-version.py delete mode 100644 .github/workflows/bump-version.yml diff --git a/.github/workflows/bump-version.py b/.github/workflows/bump-version.py deleted file mode 100644 index 71afd24..0000000 --- a/.github/workflows/bump-version.py +++ /dev/null @@ -1,31 +0,0 @@ -import requests -import sys - -sys.path.append("../../") -from clang_tools import binary_repo, binary_tag # noqa E402 - - -def get_latest_tag() -> str: - response = requests.get(f"{binary_repo}/releases/latest") - return response.json()["tag_name"] - - -def update_tag(current_tag, latest_tag) -> None: - file_path = "../../clang_tools/__init__.py" - with open(file_path) as file: - file_content = file.read() - - updated_content = file_content.replace(current_tag, latest_tag) - - with open(file_path, "w") as file: - file.write(updated_content) - - -if __name__ == "__main__": - latest_tag = get_latest_tag() - current_tag = binary_tag - - if latest_tag != current_tag: - update_tag(current_tag, latest_tag) - - print(latest_tag) diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml deleted file mode 100644 index 3881a05..0000000 --- a/.github/workflows/bump-version.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Bump clang-tools binaries version -on: - push: - branches: - - "main" - workflow_dispatch: - -jobs: - bump_version: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5 - - - name: Set up Python - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5 - with: - python-version: '3.x' - - - name: Install dependencies - run: pip install requests - - - name: Bump version - id: bump - run: | - cd .github/workflows - bump_tag=`python3 bump-version.py` - echo "bump_tag=$bump_tag" >> $GITHUB_OUTPUT - - cd ${{ github.workspace }} - - if git diff --exit-code; then - echo "No changes detected." - exit 0 - fi - - - name: Create Pull Request - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e #v7 - with: - add-paths: "clang_tools/__init__.py" - commit-message: "chore: bump clang-tools-static-binaries to ${{ steps.bump.outputs.bump_tag }}" - title: "Bump cpp-linter/clang-tools-static-binaries to ${{ steps.bump.outputs.bump_tag }}" - body: | - Bump [cpp-linter/clang-tools-static-binaries](https://github.com/cpp-linter/clang-tools-static-binaries/releases) to `${{ steps.bump.outputs.bump_tag }}` - - This PR was auto-generated by [create-pull-request][1] - - [1]: https://github.com/peter-evans/create-pull-request - base: main - labels: dependencies - branch: bump-clang-tools-static-binaries-version - delete-branch: true