v1.4.5.1 Initial #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ClashX | |
on: | |
push: | |
branches: | |
- master | |
- meta | |
- meta-dev | |
- zh_TW | |
tags: [ v* ] | |
jobs: | |
build: | |
runs-on: macos-14 | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: build infos | |
run: | | |
/usr/libexec/PlistBuddy -c "Set CFBundleVersion $(git rev-list --count origin/master..origin/meta)" ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $(git describe --tags --abbrev=0)" ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c "Add coreVersion string $(ls clash.meta | grep -m1 "" | sed -ne 's/.*64-\(.*\).gz/\1/p')" ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c "Add gitBranch string $GITHUB_REF_NAME" ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c "Add gitCommit string ${GITHUB_SHA::7}" ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c "Add buildTime string $(date +%Y-%m-%d\ %H:%M)" ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c 'Print coreVersion' ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c 'Print gitBranch' ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c 'Print gitCommit' ClashX/Info.plist | |
/usr/libexec/PlistBuddy -c 'Print buildTime' ClashX/Info.plist | |
- name: install deps | |
run: | | |
bash install_dependency.sh | |
xcodebuild -resolvePackageDependencies -project ClashX.xcodeproj | |
- name: build | |
run: | | |
xcodebuild archive -project ClashX.xcodeproj -scheme ClashX\ Meta -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" | |
- name: upload Artifact | |
uses: actions/upload-artifact@v4 | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
with: | |
name: "ClashX Meta" | |
path: "*.zip" | |