Skip to content

Commit 5c764b2

Browse files
authored
Auto-deploy to CocoaPods (#201)
1 parent a77c0ac commit 5c764b2

File tree

6 files changed

+43
-116
lines changed

6 files changed

+43
-116
lines changed

.github/workflows/cd.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: cd
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
deploy:
10+
runs-on: macos-latest
11+
steps:
12+
- name: Git Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0 # required to be able to find Git tags
16+
17+
- name: Deploy to CocoaPods Trunk
18+
run: |
19+
set -eo pipefail
20+
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
21+
pod lib lint --allow-warnings
22+
pod trunk push --allow-warnings
23+
env:
24+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16+
lint-podspec:
17+
name: lint podspec
18+
runs-on: macos-latest
19+
steps:
20+
- name: Git Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0 # required to be able to find Git tags
24+
25+
- name: Lint Podspec
26+
run: |
27+
set -eo pipefail
28+
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
29+
pod lib lint --allow-warnings
30+
1631
ci:
1732
name: ${{ matrix.platform[0] }} ${{ matrix.platform[1] }}
1833
runs-on: ${{ matrix.os }}
@@ -41,7 +56,6 @@ jobs:
4156
- platform: [macos, 12]
4257
os: macos-12
4358
xcode: 14.0.1
44-
4559
steps:
4660
- name: Git Checkout
4761
uses: actions/checkout@v3
@@ -54,8 +68,5 @@ jobs:
5468
- name: Install Homebrew dependencies
5569
run: brew install xcbeautify
5670

57-
- name: Lint Podspec
58-
run: pod lib lint
59-
6071
- name: Run Tests
6172
run: fastlane ${{ matrix.platform[0] }} test version:${{ matrix.platform[1] }}

Gemfile

Lines changed: 0 additions & 3 deletions
This file was deleted.

Gemfile.lock

Lines changed: 0 additions & 97 deletions
This file was deleted.

Introspect.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'Introspect'
3-
spec.version = '0.2.2'
3+
spec.version = ENV['LIB_VERSION']
44
spec.license = { type: 'MIT' }
55
spec.homepage = 'https://github.com/siteline/SwiftUI-Introspect.git'
66
spec.authors = { 'Lois Di Qual' => 'lois@siteline.com' }

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,14 @@ Releasing
166166
---------
167167

168168
1. Update changelog with new version
169-
2. Bump version in `Introspect.podspec`
170-
3. PR and merge changes
171-
4. Tag new version:
169+
2. PR as 'Bump to X.Y.Z' and merge it
170+
3. Tag new version:
172171

173172
```sh
174-
$ git tag -a <VERSION> -m "<MESSAGE>"
173+
$ git tag X.Y.Z
175174
$ git push origin --tags
176175
```
177176

178-
5. Push to CocoaPods trunk:
179-
180-
```sh
181-
$ bundle exec pod trunk push .
182-
```
183-
184-
185177
<!-- References -->
186178

187179
[GithubCI_Status]: https://github.com/siteline/swiftui-introspect/actions/workflows/ci.yml/badge.svg?branch=master

0 commit comments

Comments
 (0)