Skip to content

Merge branch 'meta-dev' into meta #37

Merge branch 'meta-dev' into meta

Merge branch 'meta-dev' into meta #37

Workflow file for this run

name: ClashX
on:
push:
tags: [ v* ]
workflow_dispatch:
inputs:
logLevel:
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
jobs:
build:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: FranzDiebold/github-env-vars-action@v2
- name: download meta core
uses: robinraju/[email protected]
with:
repository: 'MetaCubeX/Clash.Meta'
tag: "v1.16.0"
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 $CI_ACTION_REF_NAME" ClashX/Info.plist
/usr/libexec/PlistBuddy -c "Add gitCommit string $CI_SHA_SHORT" 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
- name: build
if: startsWith(github.ref, 'refs/tags/')
run: |
xcodebuild -resolvePackageDependencies -project ClashX.xcodeproj
xcodebuild archive -project ClashX.xcodeproj -scheme ClashX\ Meta -archivePath archive/ClashX.xcarchive -showBuildTimingSummary -allowProvisioningUpdates
- name: build-SwiftUI
run: |
xcodebuild -resolvePackageDependencies -project ClashX\ SwiftUI.xcodeproj
xcodebuild archive -project ClashX\ SwiftUI.xcodeproj -scheme ClashX\ Meta -archivePath archive/ClashX\ SwiftUI.xcarchive -showBuildTimingSummary -allowProvisioningUpdates
- name: create zip
if: startsWith(github.ref, 'refs/tags/')
run: ditto -c -k --sequesterRsrc --keepParent archive/ClashX.xcarchive/Products/Applications/ClashX\ Meta.app "ClashX Meta.zip"
- name: create SwiftUI zip
run: ditto -c -k --sequesterRsrc --keepParent archive/ClashX\ SwiftUI.xcarchive/Products/Applications/ClashX\ Meta.app "ClashX Meta macOS 12.0+.zip"
- name: upload Artifact
uses: actions/upload-artifact@v3
if: "!startsWith(github.ref, 'refs/tags/')"
with:
name: "ClashX Meta.zip"
path: "*.zip"
- name: upload build to github
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
generate_release_notes: true
files: |
ClashX Meta.zip
ClashX Meta macOS 12.0+.zip