Skip to content

Commit 23e3937

Browse files
committed
Add Buildkite
1 parent 695d134 commit 23e3937

4 files changed

Lines changed: 124 additions & 1 deletion

File tree

.buildkite/pipeline.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Nodes with values to reuse in the pipeline.
2+
common_params:
3+
plugins: &common_plugins
4+
- &bash_cache automattic/bash-cache#2.0.0: ~
5+
# Common environment values to use with the `env` key.
6+
env: &common_env
7+
IMAGE_ID: xcode-13
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"
15+
key: "test"
16+
command: |
17+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
18+
gem install bundler:2.3.4
19+
20+
build_and_test_pod
21+
env: *common_env
22+
plugins: *common_plugins
23+
24+
#################
25+
# Validate Podspecs
26+
#################
27+
- label: "🔬 Validate Podspecs"
28+
key: "validate"
29+
command: |
30+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
31+
gem install bundler:2.3.4
32+
33+
validate_podspec
34+
env: *common_env
35+
plugins: *common_plugins
36+
37+
#################
38+
# Lint
39+
#################
40+
- label: "🧹 Lint"
41+
key: "lint"
42+
command: |
43+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
44+
gem install bundler:2.3.4
45+
46+
lint_pod
47+
env: *common_env
48+
plugins: *common_plugins
49+
50+
#################
51+
# Publish the Podspec (if we're building a tag)
52+
#################
53+
- label: "⬆️ Publish Aztec Podspec"
54+
key: "publish-aztec"
55+
command: .buildkite/publish-aztec-pod.sh
56+
env: *common_env
57+
plugins: *common_plugins
58+
depends_on:
59+
- "test"
60+
- "validate"
61+
- "lint"
62+
if: build.tag != null
63+
agents:
64+
queue: "mac"
65+
66+
#################
67+
# Publish the Podspec (if we're building a tag)
68+
#################
69+
- label: "⬆️ Publish Editor Podspec"
70+
key: "publish-editor"
71+
command: .buildkite/publish-editor-pod.sh
72+
env: *common_env
73+
plugins: *common_plugins
74+
depends_on:
75+
- "test"
76+
- "validate"
77+
- "lint"
78+
if: build.tag != null
79+
agents:
80+
queue: "mac"

.buildkite/publish-aztec-pod.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash -eu
2+
3+
PODSPEC_PATH="WordPress-Aztec-iOS.podspec"
4+
SPECS_REPO="git@github.com:wordpress-mobile/cocoapods-specs.git"
5+
SLACK_WEBHOOK=$PODS_SLACK_WEBHOOK
6+
7+
echo "--- :rubygems: Setting up Gems"
8+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
9+
gem install bundler:2.3.4
10+
11+
install_gems
12+
13+
echo "--- :cocoapods: Publishing Pod to CocoaPods CDN"
14+
publish_pod $PODSPEC_PATH
15+
16+
echo "--- :cocoapods: Publishing Pod to WP Specs Repo"
17+
publish_private_pod $PODSPEC_PATH $SPECS_REPO "$SPEC_REPO_PUBLIC_DEPLOY_KEY"
18+
19+
echo "--- :slack: Notifying Slack"
20+
slack_notify_pod_published $PODSPEC_PATH $SLACK_WEBHOOK

.buildkite/publish-editor.pod.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash -eu
2+
3+
PODSPEC_PATH="WordPress-Editor-iOS.podspec"
4+
SPECS_REPO="git@github.com:wordpress-mobile/cocoapods-specs.git"
5+
SLACK_WEBHOOK=$PODS_SLACK_WEBHOOK
6+
7+
echo "--- :rubygems: Setting up Gems"
8+
# See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16
9+
gem install bundler:2.3.4
10+
11+
install_gems
12+
13+
echo "--- :cocoapods: Publishing Pod to CocoaPods CDN"
14+
publish_pod $PODSPEC_PATH
15+
16+
echo "--- :cocoapods: Publishing Pod to WP Specs Repo"
17+
publish_private_pod $PODSPEC_PATH $SPECS_REPO "$SPEC_REPO_PUBLIC_DEPLOY_KEY"
18+
19+
echo "--- :slack: Notifying Slack"
20+
slack_notify_pod_published $PODSPEC_PATH $SLACK_WEBHOOK

Gemfile.lock

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
GEM
2+
specs:
3+
14
GEM
25
remote: https://rubygems.org/
36
specs:
@@ -73,4 +76,4 @@ DEPENDENCIES
7376
cocoapods (= 1.7.5)!
7477

7578
BUNDLED WITH
76-
2.0.2
79+
2.2.33

0 commit comments

Comments
 (0)