Skip to content

Commit

Permalink
Merge pull request #846 from Mantle/cocoapods
Browse files Browse the repository at this point in the history
Make Cocoapods support official & set-up auto-deploy from tag push via GitHub Actions
  • Loading branch information
abotkin-cpi committed Jan 27, 2020
2 parents cda1610 + 6114af2 commit 36cf2f5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/cocoapods-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: cocoapods-publish

on:
push:
tags:
- '*'

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v1
- name: Updating submodules
run: git submodule update --init --recursive
- name: Get the version from tag
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Publish to Cocoapods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
MANTLE_VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
mkdir -p tmp
# Modify the podspec with the version & tag and run lint on it
jq --arg VERSION "$MANTLE_VERSION" '. | .version |= $VERSION | .source.tag |= $VERSION' Mantle.podspec.json > tmp/Mantle.podspec.json
pod spec lint tmp/Mantle.podspec.json --skip-import-validation --allow-warnings
# Print out the podspec we'll submit
cat tmp/Mantle.podspec.json
# Time to ship!
pod trunk push tmp/Mantle.podspec.json --skip-import-validation --allow-warnings
30 changes: 30 additions & 0 deletions Mantle.podspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "Mantle",
"summary": "Model framework for Cocoa and Cocoa Touch.",
"homepage": "https://github.com/Mantle/Mantle",
"license": "MIT",
"authors": {
"Robert Böhnke": "[email protected]",
"David Caunt": "[email protected]",
"Jan Gorman": "[email protected]"
},
"source": {
"git": "https://github.com/Mantle/Mantle.git"
},
"platforms": {
"ios": "5.0",
"osx": "10.7",
"watchos": "2.0",
"tvos": "9.0"
},
"requires_arc": true,
"frameworks": "Foundation",
"source_files": "Mantle",
"subspecs": [
{
"name": "extobjc",
"source_files": "Mantle/extobjc",
"private_header_files": "Mantle/extobjc/*.h"
}
]
}

0 comments on commit 36cf2f5

Please sign in to comment.