Skip to content

Commit

Permalink
chore: scripts to publish to cocoapods
Browse files Browse the repository at this point in the history
  • Loading branch information
elylucas committed Aug 30, 2021
1 parent dd63815 commit ab960a8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -17,6 +17,21 @@ jobs:
uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Latest
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/checkout@v2
- name: Restore Dependency Cache
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- name: Get Package Version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
with:
path: core/
lint:
runs-on: macos-latest
timeout-minutes: 30
Expand Down Expand Up @@ -169,6 +184,27 @@ jobs:
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- run: npm install
- run: npm run lerna:publish:latest || true
publish-ios:
runs-on: macos-latest
timeout-minutes: 30
needs:
- deploy-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Cocoapods
run: gem install cocoapods
- name: Deploy to Cocoapods
run: |
set -eo pipefail
pod trunk push ./ios/CapacitorCordova.podspec --allow-warnings
pod trunk push ./ios/Capacitor.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
publish-android:
runs-on: ubuntu-latest
needs:
Expand Down
10 changes: 5 additions & 5 deletions ios/Capacitor.podspec
Expand Up @@ -9,10 +9,10 @@ Pod::Spec.new do |s|
s.homepage = 'https://capacitorjs.com/'
s.ios.deployment_target = '12.0'
s.authors = { 'Ionic Team' => 'hi@ionicframework.com' }
s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s }
s.source_files = 'Capacitor/Capacitor/*.{swift,h,m}', 'Capacitor/Capacitor/Plugins/*.{swift,h,m}', 'Capacitor/Capacitor/Plugins/**/*.{swift,h,m}'
s.module_map = 'Capacitor/Capacitor/Capacitor.modulemap'
s.resources = ['Capacitor/Capacitor/assets/native-bridge.js']
s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :branch => "portals-dev" }
s.source_files = 'ios/Capacitor/Capacitor/*.{swift,h,m}', 'ios/Capacitor/Capacitor/Plugins/*.{swift,h,m}', 'ios/Capacitor/Capacitor/Plugins/**/*.{swift,h,m}'
s.module_map = 'ios/Capacitor/Capacitor/Capacitor.modulemap'
s.resources = ['ios/Capacitor/Capacitor/assets/native-bridge.js']
s.dependency 'CapacitorCordova'
s.swift_version = '5.0'
s.swift_version = '5.1'
end
6 changes: 3 additions & 3 deletions ios/CapacitorCordova.podspec
Expand Up @@ -10,9 +10,9 @@ Pod::Spec.new do |s|
s.authors = { 'Ionic Team' => 'hi@ionicframework.com' }
s.source = { :git => 'https://github.com/ionic-team/capacitor', :tag => s.version.to_s }
s.platform = :ios, 12.0
s.source_files = 'CapacitorCordova/**/*.{h,m}'
s.public_header_files = 'CapacitorCordova/CapacitorCordova/Classes/Public/*.h', 'CapacitorCordova/CapacitorCordova/CapacitorCordova.h'
s.module_map = 'CapacitorCordova/CapacitorCordova/CapacitorCordova.modulemap'
s.source_files = 'ios/CapacitorCordova/CapacitorCordova/**/*.{h,m}'
s.public_header_files = 'ios/CapacitorCordova/CapacitorCordova/Classes/Public/*.h', 'ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.h'
s.module_map = 'ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.modulemap'
s.requires_arc = true
s.framework = "WebKit"
end
6 changes: 2 additions & 4 deletions ios/package.json
Expand Up @@ -19,11 +19,9 @@
"CapacitorCordova.podspec"
],
"scripts": {
"verify": "npm run xc:build:Capacitor && npm run xc:build:CapacitorCordova && npm run pod:lint:Capacitor && npm run pod:lint:CapacitorCordova",
"verify": "npm run xc:build:Capacitor && npm run xc:build:CapacitorCordova",
"xc:build:Capacitor": "cd Capacitor && xcodebuild -workspace Capacitor.xcworkspace -scheme Capacitor && cd ..",
"xc:build:CapacitorCordova": "cd CapacitorCordova && xcodebuild && cd ..",
"pod:lint:Capacitor": "pod lib lint --allow-warnings Capacitor.podspec",
"pod:lint:CapacitorCordova": "pod lib lint --allow-warnings CapacitorCordova.podspec"
"xc:build:CapacitorCordova": "cd CapacitorCordova && xcodebuild && cd .."
},
"peerDependencies": {
"@capacitor/core": "^3.2.0"
Expand Down

0 comments on commit ab960a8

Please sign in to comment.