Skip to content

ClashX

ClashX #233

Workflow file for this run

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.8"
# 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
uses: actions/checkout@v4
# if: startsWith(github.ref, 'refs/tags/')
with:
ref: sparkle
path: 'sparkle'
- name: update sparkle
run: |
brew install sparkle
# touch "ClashX Meta.zip"
# cp "ClashX Meta.zip" "sparkle/ClashX Meta $GITHUB_REF_NAME.zip"
echo '${{ secrets.ED_KEY }}' | $(brew --prefix)/Caskroom/sparkle/2.*/bin/generate_appcast sparkle --ed-key-file -
cd sparkle
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