Skip to content

Commit

Permalink
ios: remove xcframework in source code
Browse files Browse the repository at this point in the history
  • Loading branch information
s1rius committed Nov 7, 2023
1 parent 5ae8710 commit ad4f216
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 252 deletions.
57 changes: 47 additions & 10 deletions .github/workflows/publish_ios.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,62 @@
name: Publish-iOS

on:
push:
# Pattern matched against refs/tags
tags:
- "*" # Push events to every tag not containing /
on: workflow_dispatch

jobs:
publish-ios:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-10-13
override: true
components: rustfmt, clippy

- name: Install iOS target
run: >
rustup target add
aarch64-apple-ios
- name: Add macOS rust std
run: >
rustup component add rust-src --toolchain nightly-2023-10-13-x86_64-apple-darwin
- name: Build xcframework
working-directory: ./ios
run: b_ios.sh

- name: Get last tag
run: |
git fetch --tags
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
echo "Latest git tag: $LATEST_TAG"

- name: Zip
working-directory: ./ios
run: |
mkdir build
pushd framework
zip -r ../build/ezlog_${{ env.LATEST_TAG }}_xcframework.zip ezlog.xcframework
- name: Upload xcframework
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.LATEST_TAG }}
name: apple:${{ env.LATEST_TAG }}
files: |
./ios/build/*
- name: Install Cocoapods
run: gem install cocoapods

- name: Deploy to Cocoapods
run: |
set -eo pipefail
chmod +x ./publish_ios.sh
./publish_ios.sh
# pod lib lint EZLog.podspec --verbose
run: pod trunk push EZLog.podspec --allow-warnings
shell: bash
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
22 changes: 19 additions & 3 deletions ios/EZLog.podspec → EZLog.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,28 @@ Pod::Spec.new do |s|
DESC

s.homepage = 'https://github.com/s1rius/ezlog'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.license = { :type => 'MIT', :file => 'LICENSE-MIT' }
s.author = { 's1rius' => '[email protected]' }
s.source = { :git => 'https://github.com/s1rius/ezlog.git', :tag => s.version.to_s }
s.source = { :git => 'https://github.com/s1rius/ezlog.git', :tag => '0.2.0' }

s.ios.deployment_target = '13.0'

s.prepare_command = <<-CMD
if [ -d "./ios/framework/" ] && [ "$(find ./ios/framework/ -mindepth 1 -print -quit)" ]; then
echo "framework folder exists and is not empty, exit"
exit 0
fi
echo "download framework from internet"
mkdir ./ios/build
curl -L -o ./ios/build/ezlog.xcframework.zip "https://github.com/s1rius/ezlog/releases/download/0.2.0/ezlog_0.2.0_xcframework.zip"
if [ -s "./ios/build/ezlog.xcframework.zip" ]; then
echo "unzip xcframework"
unzip -o ./ios/build/ezlog.xcframework.zip -d ./ios/framework
else
echo "xcframework build from source"
pushd ios
sh b_ios.sh
fi
CMD
s.source_files = 'ios/EZLog/Sources/**/*'
s.ios.vendored_frameworks = 'ios/framework/ezlog.xcframework'
end
2 changes: 2 additions & 0 deletions bump.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
# usage ./bump.sh 2.0.0 2.0.1

set -e

EXCLUDE_DIR='./target'
Expand Down
4 changes: 3 additions & 1 deletion ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
Pods/
Pods/

framework/
6 changes: 3 additions & 3 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ target 'demo' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for demo
platform :ios, '14.0'

end

target 'EZLog' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for ezlog
platform :ios, '13.0'

end

Expand All @@ -25,7 +25,7 @@ target 'benchmark' do

# Pods for benchmark

pod 'Logan', '~> 1.2.7'
pod 'Logan', '~> 1.2.9'

end

Expand Down
14 changes: 7 additions & 7 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PODS:
- Logan (1.2.7):
- Logan/mbedtls (= 1.2.7)
- Logan/mbedtls (1.2.7)
- Logan (1.2.9):
- Logan/mbedtls (= 1.2.9)
- Logan/mbedtls (1.2.9)

DEPENDENCIES:
- Logan (~> 1.2.7)
- Logan (~> 1.2.9)

SPEC REPOS:
trunk:
- Logan

SPEC CHECKSUMS:
Logan: d7e508f88d596b186e9cdcc0cf35b45c89bbc22f
Logan: bbfd2c6d9b88d5048145f832751ef32052bfe530

PODFILE CHECKSUM: b0d6f635dfe42a64aae58a146db3096d2e027e01
PODFILE CHECKSUM: 200da04e775c91e5c5b67a8458f5cc9ce8980ca6

COCOAPODS: 1.12.1
COCOAPODS: 1.14.2
48 changes: 0 additions & 48 deletions ios/framework/ezlog.xcframework/Info.plist

This file was deleted.

86 changes: 0 additions & 86 deletions ios/framework/ezlog.xcframework/ios-arm64/Headers

This file was deleted.

Binary file removed ios/framework/ezlog.xcframework/ios-arm64/libezlog.a
Binary file not shown.
86 changes: 0 additions & 86 deletions ios/framework/ezlog.xcframework/ios-arm64_x86_64-simulator/Headers

This file was deleted.

Binary file not shown.
Loading

0 comments on commit ad4f216

Please sign in to comment.