Skip to content

Commit dede3d5

Browse files
authored
Merge pull request #226 from mapbox/feature/check-pods
Check CocoaPods trunk before posting
2 parents 38054bd + ca1b3c1 commit dede3d5

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

.github/workflows/deploy_cocoapods.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,32 @@ name: Deploy to CocoaPods
33
on:
44
push:
55
tags:
6-
- '*'
6+
- "*"
77

88
jobs:
99
deploy-to-cocoapods:
1010
runs-on: macos-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v4
1313

14-
- name: Configure .netrc
15-
run: |
16-
echo "machine api.mapbox.com login mapbox password ${{ secrets.SDK_REGISTRY_TOKEN }}" >> ~/.netrc
17-
chmod 0600 ~/.netrc
14+
- name: Configure .netrc
15+
run: |
16+
echo "machine api.mapbox.com login mapbox password ${{ secrets.SDK_REGISTRY_TOKEN }}" >> ~/.netrc
17+
chmod 0600 ~/.netrc
1818
19-
- name: Deploy to Cocoapods
20-
run: pod trunk push
21-
env:
22-
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
19+
- name: Validate missing CocoaPods spec on trunk
20+
run: |
21+
PODSPEC_URL="https://cdn.jsdelivr.net/cocoa/Specs/0/6/6/MapboxCoreMaps/${GITHUB_REF_NAME#v}/MapboxCoreMaps.podspec.json"
22+
echo "Checking URL: $PODSPEC_URL"
23+
24+
if curl --location --silent --fail --head --output /dev/null "$PODSPEC_URL";
25+
then
26+
echo "Spec already exists on trunk"
27+
exit 1
28+
else
29+
echo "Spec does not exist on trunk"
30+
fi
31+
- name: Deploy to Cocoapods
32+
run: pod trunk push
33+
env:
34+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

0 commit comments

Comments
 (0)