From 73a8b232579bc0b1bfccd3841b0a9ee2bb398b50 Mon Sep 17 00:00:00 2001 From: yeongpin Date: Tue, 22 Apr 2025 10:27:08 +0800 Subject: [PATCH] Update version to 1.10.05, remove block_domain.txt from build specification, and enhance GitHub Actions workflow to dynamically determine version from .env file or manual input. Update CHANGELOG for new version release. --- .env | 4 +- .github/workflows/build.yml | 103 ++++++++++++++++++++++++++++++------ CHANGELOG.md | 6 +++ build.spec | 3 +- 4 files changed, 95 insertions(+), 21 deletions(-) diff --git a/.env b/.env index 77e0048..f200b34 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -version=1.10.04 -VERSION=1.10.04 +version=1.10.05 +VERSION=1.10.05 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d62fd5..89a1b24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,10 +3,14 @@ name: Build Executables on: workflow_dispatch: inputs: - version: - description: 'Version number (e.g. 1.0.9)' + use_env_version: + description: 'Use version from .env file (yes/no)' required: true - default: '1.10.04' + default: 'yes' + version: + description: 'Version number (only used if not using .env version)' + required: false + default: '' permissions: contents: write @@ -14,7 +18,40 @@ permissions: packages: write jobs: + determine-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.set-version.outputs.version }} + steps: + - uses: actions/checkout@v2 + + - name: Get version from .env file + id: env-version + if: ${{ github.event.inputs.use_env_version == 'yes' }} + run: | + VERSION=$(grep "^version=" .env | cut -d'=' -f2) + echo "ENV_VERSION=$VERSION" >> $GITHUB_ENV + echo "::set-output name=version::$VERSION" + echo "Using version from .env file: $VERSION" + + - name: Use manual version + id: manual-version + if: ${{ github.event.inputs.use_env_version != 'yes' }} + run: | + echo "::set-output name=version::${{ github.event.inputs.version }}" + echo "Using manually entered version: ${{ github.event.inputs.version }}" + + - name: Set final version + id: set-version + run: | + if [ "${{ github.event.inputs.use_env_version }}" == "yes" ]; then + echo "::set-output name=version::${{ env.ENV_VERSION }}" + else + echo "::set-output name=version::${{ github.event.inputs.version }}" + fi + create-tag: + needs: determine-version runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -23,18 +60,18 @@ jobs: - name: Delete existing tag if exists run: | - if git ls-remote --tags origin | grep -q "refs/tags/v${{ github.event.inputs.version }}"; then - git push origin --delete "v${{ github.event.inputs.version }}" || true - git tag -d "v${{ github.event.inputs.version }}" || true + if git ls-remote --tags origin | grep -q "refs/tags/v${{ needs.determine-version.outputs.version }}"; then + git push origin --delete "v${{ needs.determine-version.outputs.version }}" || true + git tag -d "v${{ needs.determine-version.outputs.version }}" || true fi - name: Create Tag run: | - git tag "v${{ github.event.inputs.version }}" - git push origin "v${{ github.event.inputs.version }}" + git tag "v${{ needs.determine-version.outputs.version }}" + git push origin "v${{ needs.determine-version.outputs.version }}" build-windows: - needs: create-tag + needs: [determine-version, create-tag] runs-on: windows-latest steps: @@ -47,7 +84,7 @@ jobs: - name: Set version shell: bash - run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + run: echo "VERSION=${{ needs.determine-version.outputs.version }}" >> $GITHUB_ENV - name: Install dependencies run: | @@ -58,6 +95,33 @@ jobs: - name: Build EXE run: | pyinstaller build.spec + + - name: Add Windows Defender exclusions + run: | + # 创建一个 .exe.config 文件,有时可以减少误报 + echo '' > "dist/CursorFreeVIP_${{ env.VERSION }}_windows.exe.config" + + # 添加数字签名信息文件 + echo "CursorFreeVIP ${{ env.VERSION }}" > "dist/CursorFreeVIP_${{ env.VERSION }}_windows.exe.manifest" + echo "Publisher: CursorFreeVIP Project" >> "dist/CursorFreeVIP_${{ env.VERSION }}_windows.exe.manifest" + echo "Version: ${{ env.VERSION }}" >> "dist/CursorFreeVIP_${{ env.VERSION }}_windows.exe.manifest" + echo "Description: Cursor Free VIP Tool" >> "dist/CursorFreeVIP_${{ env.VERSION }}_windows.exe.manifest" + + - name: Install SignTool + run: | + choco install windows-sdk-10-version-2004-all -y + + - name: Create self-signed certificate + if: false # Disabled until we have a proper certificate + run: | + $cert = New-SelfSignedCertificate -Subject "CN=CursorFreeVIP" -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My + $pwd = ConvertTo-SecureString -String "password" -Force -AsPlainText + Export-PfxCertificate -Cert $cert -FilePath certificate.pfx -Password $pwd + + - name: Sign executable + if: false # Disabled until we have a proper certificate + run: | + & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /f certificate.pfx /p password /t http://timestamp.digicert.com /d "CursorFreeVIP" /v "dist/CursorFreeVIP_${{ env.VERSION }}_windows.exe" - name: Upload Windows artifact uses: actions/upload-artifact@v4 @@ -66,7 +130,7 @@ jobs: path: dist/CursorFreeVIP_${{ env.VERSION }}_windows.exe build-macos-arm64: - needs: create-tag + needs: [determine-version, create-tag] runs-on: macos-latest steps: @@ -79,7 +143,7 @@ jobs: - name: Set version shell: bash - run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + run: echo "VERSION=${{ needs.determine-version.outputs.version }}" >> $GITHUB_ENV - name: Install dependencies run: | @@ -91,6 +155,11 @@ jobs: run: | pyinstaller build.spec mv "dist/CursorFreeVIP_${{ env.VERSION }}_mac" "dist/CursorFreeVIP_${{ env.VERSION }}_mac_arm64" + + - name: Sign macOS executable + if: false # Disabled until we have a proper certificate + run: | + codesign --force --options runtime --sign "Developer ID Application" "dist/CursorFreeVIP_${{ env.VERSION }}_mac_arm64" - name: Upload MacOS ARM artifact uses: actions/upload-artifact@v4 @@ -112,7 +181,7 @@ jobs: - name: Set version shell: bash - run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + run: echo "VERSION=${{ needs.determine-version.outputs.version }}" >> $GITHUB_ENV - name: Install dependencies run: | @@ -149,7 +218,7 @@ jobs: - name: Set version shell: bash - run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + run: echo "VERSION=${{ needs.determine-version.outputs.version }}" >> $GITHUB_ENV - name: Build in ARM64 Docker container run: | @@ -184,7 +253,7 @@ jobs: - name: Set version shell: bash - run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + run: echo "VERSION=${{ needs.determine-version.outputs.version }}" >> $GITHUB_ENV - name: Install dependencies run: | @@ -207,7 +276,7 @@ jobs: path: dist/CursorFreeVIP_${{ env.VERSION }}_mac_intel create-release: - needs: [build-windows, build-macos-arm64, build-linux-x64, build-linux-arm64, build-macos-intel] + needs: [determine-version, build-windows, build-macos-arm64, build-linux-x64, build-linux-arm64, build-macos-intel] runs-on: ubuntu-22.04 steps: @@ -216,7 +285,7 @@ jobs: - name: Get version shell: bash - run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + run: echo "VERSION=${{ needs.determine-version.outputs.version }}" >> $GITHUB_ENV - name: Download all artifacts uses: actions/download-artifact@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index e8c41c4..bd12e5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## v1.10.05 +1. Remove block_domain.txt | 移除 block_domain.txt +2. Original Code In Github , If u afraid of virus, please clone the code and run locally | 原始碼在 Github 上,如果怕病毒,請複製原始碼並在本機運行 +3. Fix: Some Issues | 修復一些問題 + + ## v1.10.04 1. Hotfix: Reset Process Error: cannot access local variable 'main_path' where it is not associated with a value on windows & macos | 修復在 Windows 和 macOS 上無法訪問局部變量 'main_path' 的問題 2. Fix: Some Issues | 修復一些問題 diff --git a/build.spec b/build.spec index 8dba0ba..6e79298 100644 --- a/build.spec +++ b/build.spec @@ -26,8 +26,7 @@ a = Analysis( ('locales', 'locales'), ('quit_cursor.py', '.'), ('utils.py', '.'), - ('.env', '.'), - ('block_domain.txt', '.') + ('.env', '.') ], hiddenimports=[ 'quit_cursor',