From 7e8d7f84fab4e1a6eb557ed6da64c94df50c2fad Mon Sep 17 00:00:00 2001 From: Pylogmon Date: Fri, 22 Dec 2023 14:20:33 +0800 Subject: [PATCH] chore: Remove unnecessary actions --- .github/actions/qq_notify/qq_notify.py | 19 --- .github/workflows/Notify.yml | 163 ------------------------- .github/workflows/Review.yml | 26 ---- .gitlab/ci.yml | 62 ---------- {patch => patches}/hyprland.patch | 0 5 files changed, 270 deletions(-) delete mode 100644 .github/actions/qq_notify/qq_notify.py delete mode 100644 .github/workflows/Review.yml delete mode 100644 .gitlab/ci.yml rename {patch => patches}/hyprland.patch (100%) diff --git a/.github/actions/qq_notify/qq_notify.py b/.github/actions/qq_notify/qq_notify.py deleted file mode 100644 index 2feb9b8eac..0000000000 --- a/.github/actions/qq_notify/qq_notify.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -import asyncio -import os -import botpy - -appid = os.getenv('APPID') -token = os.getenv('TOKEN') -channelid = os.getenv('CHANNELID') -message = os.getenv('MESSAGE') - - -async def run(): - http = botpy.BotHttp(5, app_id=appid, token=token) - api = botpy.BotAPI(http) - - await api.post_message(channel_id=channelid, content=message) - - -asyncio.run(run()) \ No newline at end of file diff --git a/.github/workflows/Notify.yml b/.github/workflows/Notify.yml index e6a9fe73c5..acec5c1523 100644 --- a/.github/workflows/Notify.yml +++ b/.github/workflows/Notify.yml @@ -101,166 +101,3 @@ jobs: ${{ github.event.pull_request.body }} button_name: 👀前往查看👀 button_url: ${{ github.event.pull_request.html_url }} - qq-notify: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - run: pip install qq-botpy - - name: Get Body - if: endsWith(github.event_name,'comment') - run: | - input_string="${{ github.event.comment.body }}" - url_pattern="https?://[^\s]*|[^\s]*\.[^\s]*" - modified_input_string="$input_string" - - for url in $(echo "$input_string" | grep -oE "$url_pattern"); do - url_without_https=${url#https:} # Remove https: - url_without_http=${url_without_https#http:} # Remove http: - url_with_dots_replaced=${url_without_https//./_} # Replace . with _ - - modified_input_string=${modified_input_string//$url/$url_with_dots_replaced} - done - echo "BODY<> $GITHUB_ENV - echo $modified_input_string >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - name: Get Body - if: github.event_name == 'issues' - run: | - input_string="${{ github.event.issue.body }}" - url_pattern="https?://[^\s]*|[^\s]*\.[^\s]*" - modified_input_string="$input_string" - - for url in $(echo "$input_string" | grep -oE "$url_pattern"); do - url_without_https=${url#https:} # Remove https: - url_without_http=${url_without_https#http:} # Remove http: - url_with_dots_replaced=${url_without_https//./_} # Replace . with _ - - modified_input_string=${modified_input_string//$url/$url_with_dots_replaced} - done - - echo "BODY<> $GITHUB_ENV - echo $modified_input_string >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - name: Get Body - if: github.event_name == 'discussion' - run: | - input_string="${{ github.event.discussion.body }}" - url_pattern="https?://[^\s]*|[^\s]*\.[^\s]*" - modified_input_string="$input_string" - - for url in $(echo "$input_string" | grep -oE "$url_pattern"); do - url_without_https=${url#https:} # Remove https: - url_without_http=${url_without_https#http:} # Remove http: - url_with_dots_replaced=${url_without_https//./_} # Replace . with _ - - modified_input_string=${modified_input_string//$url/$url_with_dots_replaced} - done - - echo "BODY<> $GITHUB_ENV - echo $modified_input_string >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - name: Get Body - if: github.event_name == 'pull_request_target' - run: | - input_string="${{ github.event.pull_request.body }}" - url_pattern="https?://[^\s]*|[^\s]*\.[^\s]*" - modified_input_string="$input_string" - - for url in $(echo "$input_string" | grep -oE "$url_pattern"); do - url_without_https=${url#https:} # Remove https: - url_without_http=${url_without_https#http:} # Remove http: - url_with_dots_replaced=${url_without_https//./_} # Replace . with _ - - modified_input_string=${modified_input_string//$url/$url_with_dots_replaced} - done - - echo "BODY<> $GITHUB_ENV - echo $modified_input_string >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - # issue_comment - - name: send issue_comment message - if: github.event_name == 'issue_comment' - run: python3 .github/actions/qq_notify/qq_notify.py - env: - APPID: ${{ secrets.QQ_BOT_APPID }} - TOKEN: ${{ secrets.QQ_BOT_TOKEN }} - CHANNELID: ${{ secrets.QQ_CHANNELID }} - MESSAGE: | - 📣 New ${{github.event_name}} in pot-desktop - - 💡Title: ${{ github.event.issue.title }} - - 👤User: ${{ github.event.sender.login }} - - ${{ env.BODY }} - # discussion_comment - - name: send discussion_comment message - if: github.event_name == 'discussion_comment' - run: python3 .github/actions/qq_notify/qq_notify.py - env: - APPID: ${{ secrets.QQ_BOT_APPID }} - TOKEN: ${{ secrets.QQ_BOT_TOKEN }} - CHANNELID: ${{ secrets.QQ_CHANNELID }} - MESSAGE: | - 📣 New ${{github.event_name}} in pot-desktop - - 💡Title: ${{ github.event.discussion.title }} - - 👤User: ${{ github.event.sender.login }} - - ${{ env.BODY }} - # issues - - name: send issue message - if: github.event_name == 'issues' - run: python3 .github/actions/qq_notify/qq_notify.py - env: - APPID: ${{ secrets.QQ_BOT_APPID }} - TOKEN: ${{ secrets.QQ_BOT_TOKEN }} - CHANNELID: ${{ secrets.QQ_CHANNELID }} - MESSAGE: | - 📣 New ${{github.event_name}} in pot-desktop - - 💡Title: ${{ github.event.issue.title }} - - 👤User: ${{ github.event.sender.login }} - - ${{ env.BODY }} - # discussion - - name: send discussion message - if: github.event_name == 'discussion' - run: python3 .github/actions/qq_notify/qq_notify.py - env: - APPID: ${{ secrets.QQ_BOT_APPID }} - TOKEN: ${{ secrets.QQ_BOT_TOKEN }} - CHANNELID: ${{ secrets.QQ_CHANNELID }} - MESSAGE: | - 📣 New ${{github.event_name}} in pot-desktop - - 💡Title: ${{ github.event.discussion.title }} - - 👤User: ${{ github.event.sender.login }} - - ${{ env.BODY }} - # pull_request - - name: send pull_request_target message - if: github.event_name == 'pull_request_target' - run: python3 .github/actions/qq_notify/qq_notify.py - env: - APPID: ${{ secrets.QQ_BOT_APPID }} - TOKEN: ${{ secrets.QQ_BOT_TOKEN }} - CHANNELID: ${{ secrets.QQ_CHANNELID }} - MESSAGE: | - 📣 New ${{github.event_name}} in pot-desktop - - 💡Title: ${{ github.event.pull_request.title }} - - 👤User: ${{ github.event.sender.login }} - - ${{ env.BODY }} diff --git a/.github/workflows/Review.yml b/.github/workflows/Review.yml deleted file mode 100644 index 2ca24b5871..0000000000 --- a/.github/workflows/Review.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Code Review - -permissions: - contents: read - pull-requests: write - -on: - pull_request: - types: [opened, reopened, synchronize] - -jobs: - review: - runs-on: ubuntu-latest - steps: - - uses: anc95/ChatGPT-CodeReview@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # Optional - LANGUAGE: Chinese - OPENAI_API_ENDPOINT: ${{ secrets.OPENAI_ENDPOINT }} - MODEL: gpt-3.5-turbo-16k - top_p: 1 - temperature: 1 - max_tokens: 10000 - MAX_PATCH_LENGTH: 10000 diff --git a/.gitlab/ci.yml b/.gitlab/ci.yml deleted file mode 100644 index d29cee4dd0..0000000000 --- a/.gitlab/ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -stages: - - download - - upload - - release - -download: - stage: download - image: curlimages/curl:latest - variables: - PACKAGE_VERSION: '${CI_COMMIT_TAG}' - PACKAGE_REGISTRY_URL: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/pot-desktop/${PACKAGE_VERSION}' - rules: - - if: $CI_COMMIT_TAG - script: - # 上传所有下载的文件到 GitLab Package Registry - - | - curl -s https://api.github.com/repos/pot-app/pot-desktop/releases/latest | grep "browser_download_url" | cut -d '"' -f 4 | sed 's|^|https://gh.pylogmon.com/|' | xargs -n 1 curl -O - for file in *.deb *.AppImage *.exe *.dmg *.zip *.sig *.tar.gz *.pbar *.popclipextz; do - curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file $file "${PACKAGE_REGISTRY_URL}/$file" - done - echo "BODY=$(curl -s https://api.github.com/repos/pot-app/pot-desktop/releases/latest | grep "body" | cut -d '"' -f 4)" >> build.env - artifacts: - reports: - dotenv: build.env - -release: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - variables: - PACKAGE_VERSION: '${CI_COMMIT_TAG}' - PACKAGE_REGISTRY_URL: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/pot-desktop/${PACKAGE_VERSION}' - rules: - - if: $CI_COMMIT_TAG - script: - - | - DESCRIPTION=$(echo $BODY | sed 's/\\n/\n/g' | sed 's/\\r//g') - release-cli create --name "Release $PACKAGE_VERSION" --tag-name $PACKAGE_VERSION \ - --description "${DESCRIPTION}" \ - --assets-link "{\"name\":\"pot.pbar\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot.pbar\"}" \ - --assets-link "{\"name\":\"Pot.popclipextz\",\"url\":\"${PACKAGE_REGISTRY_URL}/Pot.popclipextz\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_aarch64.app.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_aarch64.app.tar.gz\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_aarch64.app.tar.gz.sig\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_aarch64.app.tar.gz.sig\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_aarch64.dmg\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_aarch64.dmg\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x64.app.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x64.app.tar.gz\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x64.app.tar.gz.sig\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x64.app.tar.gz.sig\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x64.dmg\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x64.dmg\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_amd64.AppImage\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_amd64.AppImage\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_amd64.AppImage.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_amd64.AppImage.tar.gz\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_amd64.AppImage.tar.gz.sig\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_amd64.AppImage.tar.gz.sig\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_amd64.deb\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_amd64.deb\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_arm64.deb\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_arm64.deb\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_armhf.deb\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_armhf.deb\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_i386.deb\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_i386.deb\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x64-setup.exe\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x64-setup.exe\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x64-setup.nsis.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x64-setup.nsis.zip\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x64-setup.nsis.zip.sig\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x64-setup.nsis.zip.sig\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x86-setup.exe\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x86-setup.exe\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x86-setup.nsis.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x86-setup.nsis.zip\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_x86-setup.nsis.zip.sig\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_x86-setup.nsis.zip.sig\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_arm64-setup.exe\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_arm64-setup.exe\",\"link_type\":\"package\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_arm64-setup.nsis.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_arm64-setup.nsis.zip\"}" \ - --assets-link "{\"name\":\"pot_${PACKAGE_VERSION}_arm64-setup.nsis.zip.sig\",\"url\":\"${PACKAGE_REGISTRY_URL}/pot_${PACKAGE_VERSION}_arm64-setup.nsis.zip.sig\"}" diff --git a/patch/hyprland.patch b/patches/hyprland.patch similarity index 100% rename from patch/hyprland.patch rename to patches/hyprland.patch