From 511e341cdc53c56af80e4c1750a4eb1aba522bd0 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sat, 2 Jul 2022 23:59:39 +0800 Subject: [PATCH 01/12] Fix path. --- .github/workflows/main.yml | 4 +--- ClashX/add_build_info.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 956901e13..fd9b7b230 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,9 +27,7 @@ jobs: - name: build run: | - cd ClashX - python3 add_build_info.py - cd .. + python3 ClashX/add_build_info.py xcodebuild archive -workspace ClashX.xcworkspace -scheme ClashX -archivePath archive/ClashX.xcarchive -showBuildTimingSummary -allowProvisioningUpdates - name: create zip diff --git a/ClashX/add_build_info.py b/ClashX/add_build_info.py index fddb9c3a6..60589c44e 100644 --- a/ClashX/add_build_info.py +++ b/ClashX/add_build_info.py @@ -5,7 +5,7 @@ def write_to_info(): - path = "info.plist" + path = "ClashX/info.plist" with open(path, 'rb') as f: contents = plistlib.load(f) @@ -20,7 +20,7 @@ def write_to_info(): buildVersion = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode() contents["CFBundleShortVersionString"] = buildVersion - coreVersion = subprocess.check_output(["Resources/com.metacubex.ClashX.ProxyConfigHelper.meta", "-v"]).strip().decode().split()[2] + coreVersion = subprocess.check_output(["ClashX/Resources/com.metacubex.ClashX.ProxyConfigHelper.meta", "-v"]).strip().decode().split()[2] contents["coreVersion"] = coreVersion From d7ae03ba19542da702c71e1e13c60956172612cb Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 00:08:38 +0800 Subject: [PATCH 02/12] Fix master. --- ClashX/add_build_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClashX/add_build_info.py b/ClashX/add_build_info.py index 60589c44e..c92d5d7e7 100644 --- a/ClashX/add_build_info.py +++ b/ClashX/add_build_info.py @@ -14,7 +14,7 @@ def write_to_info(): exit(-1) - buildNumber = subprocess.check_output(["git", "rev-list", "--count", "master..meta"]).strip().decode() + buildNumber = subprocess.check_output(["git", "rev-list", "--count", "origin/master..meta"]).strip().decode() contents["CFBundleVersion"] = buildNumber buildVersion = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode() From ce2fbb10fcc49049270d8608c65e6f07bf118322 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 00:19:28 +0800 Subject: [PATCH 03/12] Test git rev-list. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd9b7b230..4954c5ba7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,6 +27,7 @@ jobs: - name: build run: | + git rev-list --count origin/master..meta python3 ClashX/add_build_info.py xcodebuild archive -workspace ClashX.xcworkspace -scheme ClashX -archivePath archive/ClashX.xcarchive -showBuildTimingSummary -allowProvisioningUpdates From 910a75cc109c7b0d733799f1476bf34aa1276655 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 00:30:12 +0800 Subject: [PATCH 04/12] Fix git rev-list. --- .github/workflows/main.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4954c5ba7..5e0224c9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,6 +16,9 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: setup Go uses: actions/setup-go@v2 with: @@ -25,10 +28,12 @@ jobs: run: | bash install_dependency.sh - - name: build + - name: build infos run: | - git rev-list --count origin/master..meta python3 ClashX/add_build_info.py + + - name: build + run: | xcodebuild archive -workspace ClashX.xcworkspace -scheme ClashX -archivePath archive/ClashX.xcarchive -showBuildTimingSummary -allowProvisioningUpdates - name: create zip From 26ec99df3c8521fab58b8f725dac1a95f9bf167c Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 10:59:17 +0800 Subject: [PATCH 05/12] Fix rev-list. --- ClashX/add_build_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClashX/add_build_info.py b/ClashX/add_build_info.py index c92d5d7e7..60589c44e 100644 --- a/ClashX/add_build_info.py +++ b/ClashX/add_build_info.py @@ -14,7 +14,7 @@ def write_to_info(): exit(-1) - buildNumber = subprocess.check_output(["git", "rev-list", "--count", "origin/master..meta"]).strip().decode() + buildNumber = subprocess.check_output(["git", "rev-list", "--count", "master..meta"]).strip().decode() contents["CFBundleVersion"] = buildNumber buildVersion = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode() From c7cf9cb35cad9af46f112205c56d5f3eddf04f69 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 11:12:30 +0800 Subject: [PATCH 06/12] Update ci. --- .github/workflows/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e0224c9a..632b6fda0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,26 +15,26 @@ jobs: build: runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 + - name: test + run: git rev-list --count master..meta + - name: setup Go uses: actions/setup-go@v2 with: go-version: 1.18.x - name: install deps - run: | - bash install_dependency.sh + run: bash install_dependency.sh - name: build infos - run: | - python3 ClashX/add_build_info.py + run: python3 ClashX/add_build_info.py - name: build - run: | - xcodebuild archive -workspace ClashX.xcworkspace -scheme ClashX -archivePath archive/ClashX.xcarchive -showBuildTimingSummary -allowProvisioningUpdates + run: xcodebuild archive -workspace ClashX.xcworkspace -scheme ClashX -archivePath archive/ClashX.xcarchive -showBuildTimingSummary -allowProvisioningUpdates - name: create zip run: ditto -c -k --sequesterRsrc --keepParent archive/ClashX.xcarchive/Products/Applications/ClashX\ Meta.app ClashX\ Meta.zip From 4c739c3230ef53204a545496141c85175e35520c Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 11:19:34 +0800 Subject: [PATCH 07/12] Fix rev-list. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 632b6fda0..78ed5f46e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: test - run: git rev-list --count master..meta + run: git rev-list --count origin/master..origin/meta - name: setup Go uses: actions/setup-go@v2 From 6afe2670a06f019ef13d4f83f9d00645c7e3d15b Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 11:29:16 +0800 Subject: [PATCH 08/12] Fix rev-list. --- ClashX/add_build_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClashX/add_build_info.py b/ClashX/add_build_info.py index 60589c44e..66b183010 100644 --- a/ClashX/add_build_info.py +++ b/ClashX/add_build_info.py @@ -14,7 +14,7 @@ def write_to_info(): exit(-1) - buildNumber = subprocess.check_output(["git", "rev-list", "--count", "master..meta"]).strip().decode() + buildNumber = subprocess.check_output(["git", "rev-list", "--count", "origin/master..origin/meta"]).strip().decode() contents["CFBundleVersion"] = buildNumber buildVersion = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode() From 107c23b71781bbc2f33e42bc2b09212a9ada947a Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 12:34:35 +0800 Subject: [PATCH 09/12] coreVersion --- ClashX/add_build_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClashX/add_build_info.py b/ClashX/add_build_info.py index 66b183010..500cf1aa0 100644 --- a/ClashX/add_build_info.py +++ b/ClashX/add_build_info.py @@ -20,7 +20,7 @@ def write_to_info(): buildVersion = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode() contents["CFBundleShortVersionString"] = buildVersion - coreVersion = subprocess.check_output(["ClashX/Resources/com.metacubex.ClashX.ProxyConfigHelper.meta", "-v"]).strip().decode().split()[2] + coreVersion = subprocess.check_output(["curl", "-s", "https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest", "|", "jq", "-r", ".name"]).strip().decode().split()[2] contents["coreVersion"] = coreVersion From 1708ed59f36cb51494cebe3bceeef05502b1e832 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 12:42:37 +0800 Subject: [PATCH 10/12] coreVersion --- ClashX/add_build_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClashX/add_build_info.py b/ClashX/add_build_info.py index 500cf1aa0..11cfbd0bf 100644 --- a/ClashX/add_build_info.py +++ b/ClashX/add_build_info.py @@ -20,7 +20,7 @@ def write_to_info(): buildVersion = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode() contents["CFBundleShortVersionString"] = buildVersion - coreVersion = subprocess.check_output(["curl", "-s", "https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest", "|", "jq", "-r", ".name"]).strip().decode().split()[2] + coreVersion = subprocess.check_output(["bash", "-c", "curl -s https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest | jq -r '.name'"]).strip().decode().split()[2] contents["coreVersion"] = coreVersion From 51992c6c697534b1d790932f821910309a766692 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 12:46:36 +0800 Subject: [PATCH 11/12] Fix coreVersion. --- ClashX/add_build_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClashX/add_build_info.py b/ClashX/add_build_info.py index 11cfbd0bf..cbe9d4310 100644 --- a/ClashX/add_build_info.py +++ b/ClashX/add_build_info.py @@ -20,7 +20,7 @@ def write_to_info(): buildVersion = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode() contents["CFBundleShortVersionString"] = buildVersion - coreVersion = subprocess.check_output(["bash", "-c", "curl -s https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest | jq -r '.name'"]).strip().decode().split()[2] + coreVersion = subprocess.check_output(["bash", "-c", "curl -s https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/latest | jq -r '.name'"]).strip().decode() contents["coreVersion"] = coreVersion From 2acf6cacb86d72088371e459d8de7f9daf743bc4 Mon Sep 17 00:00:00 2001 From: mrFq1 <1xxbx0il0@mozmail.com> Date: Sun, 3 Jul 2022 12:55:40 +0800 Subject: [PATCH 12/12] upload-artifact name. --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 78ed5f46e..bdd92288a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,8 +43,8 @@ jobs: uses: actions/upload-artifact@v3 if: "!startsWith(github.ref, 'refs/tags/')" with: - name: ClashX\ Meta.zip - path: ClashX\ Meta.zip + name: "ClashX Meta.zip" + path: "ClashX Meta.zip" - name: upload build to github uses: softprops/action-gh-release@v1 @@ -53,4 +53,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: generate_release_notes: true - files: ClashX\ Meta.zip + files: "ClashX Meta.zip"