Skip to content

Commit

Permalink
Merge remote-tracking branch 'fork/buildinfo' into meta
Browse files Browse the repository at this point in the history
  • Loading branch information
mrFq1 committed Jul 3, 2022
2 parents cd8ffbb + 2acf6ca commit ebaf989
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +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 origin/master..origin/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

- name: build
run: |
cd ClashX
python3 add_build_info.py
cd ..
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
Expand All @@ -39,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
Expand All @@ -49,4 +53,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
generate_release_notes: true
files: ClashX\ Meta.zip
files: "ClashX Meta.zip"
6 changes: 3 additions & 3 deletions ClashX/add_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -14,13 +14,13 @@ 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()
contents["CFBundleShortVersionString"] = buildVersion

coreVersion = subprocess.check_output(["Resources/com.metacubex.ClashX.ProxyConfigHelper.meta", "-v"]).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


Expand Down

0 comments on commit ebaf989

Please sign in to comment.