Merge branch 'meta-dev' into meta #57
Workflow file for this run
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: | |
tags: [ v* ] | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
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: download meta core | |
uses: robinraju/[email protected] | |
with: | |
repository: 'MetaCubeX/mihomo' | |
tag: "v1.18.10" | |
fileName: ".*darwin.*64-v.*.gz" | |
# releaseId: "62870807" | |
# fileName: ".*darwin.*64-alpha.*.gz" | |
out-file-path: "clash.meta" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- 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.zip" | |
path: "*.zip" | |
- name: load sparkle-repo | |
uses: actions/checkout@v4 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
ref: sparkle | |
path: 'sparkle-repo' | |
- name: update sparkle-repo | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
cp "ClashX Meta.zip" "sparkle-repo/ClashX Meta $GITHUB_REF_NAME.zip" | |
brew install sparkle | |
echo '${{ secrets.ED_KEY }}' | $(brew --prefix)/Caskroom/sparkle/2.*/bin/generate_appcast sparkle-repo --ed-key-file - | |
cd sparkle-repo | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add -A | |
git commit -m $GITHUB_REF_NAME | |
git push origin sparkle | |
- name: upload build to github | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
generate_release_notes: true | |
files: | | |
ClashX Meta.zip | |