Skip to content

Commit 92697d5

Browse files
committed
Add Buildkite
Fix pipeline
1 parent 9b348d0 commit 92697d5

File tree

5 files changed

+89
-1
lines changed

5 files changed

+89
-1
lines changed

.buildkite/pipeline.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Nodes with values to reuse in the pipeline.
2+
common_params:
3+
plugins: &common_plugins
4+
- &bash_cache automattic/bash-cache#v1.4.0: ~
5+
# Common environment values to use with the `env` key.
6+
env: &common_env
7+
IMAGE_ID: xcode-12.5.1
8+
9+
# This is the default pipeline – it will build and test the app
10+
steps:
11+
################
12+
# Build and Test
13+
################
14+
- label: "🧪 Build and Test iOS"
15+
key: "test"
16+
command: "build_and_test_pod"
17+
env: *common_env
18+
plugins: *common_plugins
19+
artifact_paths: ".build/logs/*.log"
20+
21+
#################
22+
# Validate Podspec
23+
#################
24+
- label: "🔬 Validating Podspec"
25+
key: "validate"
26+
command: "validate_podspec"
27+
env: *common_env
28+
plugins: *common_plugins
29+
artifact_paths: ".build/logs/*.log"
30+
31+
#################
32+
# Lint
33+
#################
34+
- label: "🧹 Lint"
35+
key: "lint"
36+
command: "lint_pod"
37+
env: *common_env
38+
plugins: *common_plugins
39+
40+
#################
41+
# Publish the Podspec (if we're building a tag)
42+
#################
43+
- label: "⬆️ Publish Podspec"
44+
key: "publish"
45+
command: .buildkite/publish-pod.sh
46+
env: *common_env
47+
plugins: *common_plugins
48+
depends_on:
49+
- "test"
50+
- "validate"
51+
- "lint"
52+
if: build.tag != null

.buildkite/publish-pod.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash -eu
2+
3+
PODSPEC_PATH="WPMediaPicker.podspec"
4+
SLACK_WEBHOOK=$PODS_SLACK_WEBHOOK
5+
6+
echo "--- :rubygems: Setting up Gems"
7+
install_gems
8+
9+
echo "--- :cocoapods: Publishing Pod to CocoaPods CDN"
10+
publish_pod $PODSPEC_PATH
11+
12+
echo "--- :slack: Notifying Slack"
13+
slack_notify_pod_published $PODSPEC_PATH $SLACK_WEBHOOK

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.DS_Store
33

44
# Xcode
5+
.build
56
build/
67
*.pbxuser
78
!default.pbxuser
@@ -19,6 +20,11 @@ DerivedData
1920
*.hmap
2021
*.ipa
2122

23+
# Fastlane
24+
fastlane/report.xml
25+
fastlane/test_output
26+
fastlane/README.md
27+
2228
# We recommend against adding the Pods directory to your .gitignore. However
2329
# you should judge for yourself, the pros and cons are mentioned at:
2430
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control

.rubocop.yml

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ AllCops:
66
Naming/FileName:
77
Exclude:
88
- 'WPMediaPicker.podspec'
9-

fastlane/Fastfile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
default_platform(:ios)
4+
5+
platform :ios do
6+
desc 'Builds the project and runs tests'
7+
lane :test do
8+
run_tests(
9+
workspace: 'Example/WPMediaPicker.xcworkspace',
10+
scheme: 'WPMediaPicker-Example',
11+
devices: ['iPhone 11'],
12+
deployment_target_version: '14.5',
13+
prelaunch_simulator: true,
14+
buildlog_path: File.join(__dir__, '.build', 'logs'),
15+
derived_data_path: File.join(__dir__, '.build', 'derived-data')
16+
)
17+
end
18+
end

0 commit comments

Comments
 (0)