From 00d8ad9a9c75991a358c7baff54d176bf81ea566 Mon Sep 17 00:00:00 2001 From: xishang0128 Date: Sun, 29 Dec 2024 22:08:22 +0800 Subject: [PATCH] remove support for old equipment --- .github/workflows/build.yml | 44 +++++++++++-------- scripts/prepare.mjs | 12 ++--- src/main/config/profile.ts | 4 +- .../src/components/settings/mihomo-config.tsx | 2 +- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3d806c..2ad2e24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,24 +94,30 @@ jobs: needs: [build] runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download Artifacts uses: actions/download-artifact@v4 with: path: bin/ merge-multiple: true - - name: Delete Current - uses: 8Mi-Tech/delete-release-assets-action@main - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - tag: pre-release - deleteOnlyFromDrafts: false + - name: Delete Pre-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if ! gh release delete pre-release --yes; then + echo "Failed to delete release, but continuing..." + fi + git log -1 --pretty=format:"%s%n%b" > changelog.md - name: Publish Prerelease if: success() uses: softprops/action-gh-release@v2 with: tag_name: pre-release + body_path: changelog.md files: | bin/latest.yml bin/dist/* @@ -126,20 +132,20 @@ jobs: uses: actions/checkout@v4 - name: Update Version - run: - INPUT_VERSION="${{ github.event.inputs.version }}" - CLEAN_VERSION=$(echo "$INPUT_VERSION" | sed 's/^v//') - if [[ ! "$CLEAN_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Invalid version format: $INPUT_VERSION" - exit 1 - fi - jq --arg version "$CLEAN_VERSION" '.version = $version' package.json > tmp.json && mv tmp.json package.json + run: | + INPUT_VERSION="${{ github.event.inputs.version }}" + CLEAN_VERSION=$(echo "$INPUT_VERSION" | sed 's/^v//') + if [[ ! "$CLEAN_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Invalid version format: $INPUT_VERSION" + exit 1 + fi + jq --arg version "$CLEAN_VERSION" '.version = $version' package.json > tmp.json && mv tmp.json package.json - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git add package.json - git commit -m "Update version to $CLEAN_VERSION" - git push + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git add package.json + git commit -m "Update version to $CLEAN_VERSION" + git push - uses: actions/download-artifact@v4 with: diff --git a/scripts/prepare.mjs b/scripts/prepare.mjs index fec61a9..96fc6b0 100644 --- a/scripts/prepare.mjs +++ b/scripts/prepare.mjs @@ -21,12 +21,12 @@ const MIHOMO_ALPHA_URL_PREFIX = `https://github.com/MetaCubeX/mihomo/releases/do let MIHOMO_ALPHA_VERSION const MIHOMO_ALPHA_MAP = { - 'win32-x64': 'mihomo-windows-amd64-compatible', + 'win32-x64': 'mihomo-windows-amd64', 'win32-ia32': 'mihomo-windows-386', 'win32-arm64': 'mihomo-windows-arm64', - 'darwin-x64': 'mihomo-darwin-amd64-compatible', + 'darwin-x64': 'mihomo-darwin-amd64', 'darwin-arm64': 'mihomo-darwin-arm64', - 'linux-x64': 'mihomo-linux-amd64-compatible', + 'linux-x64': 'mihomo-linux-amd64', 'linux-arm64': 'mihomo-linux-arm64' } @@ -52,12 +52,12 @@ const MIHOMO_URL_PREFIX = `https://github.com/MetaCubeX/mihomo/releases/download let MIHOMO_VERSION const MIHOMO_MAP = { - 'win32-x64': 'mihomo-windows-amd64-compatible', + 'win32-x64': 'mihomo-windows-amd64', 'win32-ia32': 'mihomo-windows-386', 'win32-arm64': 'mihomo-windows-arm64', - 'darwin-x64': 'mihomo-darwin-amd64-compatible', + 'darwin-x64': 'mihomo-darwin-amd64', 'darwin-arm64': 'mihomo-darwin-arm64', - 'linux-x64': 'mihomo-linux-amd64-compatible', + 'linux-x64': 'mihomo-linux-amd64', 'linux-arm64': 'mihomo-linux-arm64' } diff --git a/src/main/config/profile.ts b/src/main/config/profile.ts index e76b128..10a58fe 100644 --- a/src/main/config/profile.ts +++ b/src/main/config/profile.ts @@ -133,7 +133,7 @@ export async function createProfile(item: Partial): Promise): Promise { size="sm" className="w-[60%]" value={ua} - placeholder="默认 clash.meta" + placeholder="默认 clash.meta/alpha-de19f92" onValueChange={(v) => { setUa(v) setUaDebounce(v)