Skip to content

Commit 2a211aa

Browse files
chore: move CI/CD to GitHub Actions (#768)
1 parent b9e9cc6 commit 2a211aa

File tree

8 files changed

+129
-40
lines changed

8 files changed

+129
-40
lines changed

.github/workflows/deployment.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deployment
2+
on:
3+
push:
4+
tags:
5+
- patch
6+
- minor
7+
- major
8+
jobs:
9+
# echo "COCOAPODS_TRUNK_TOKEN=${{ secrets.COCOAPODS_TRUNK_TOKEN }}" >> $GITHUB_ENV
10+
deploy:
11+
runs-on: macos-11
12+
env:
13+
GITHUB_ACTION: ${{ github.action_path }}
14+
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
15+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
16+
steps:
17+
- uses: actions/setup-go@v2
18+
with:
19+
go-version: '1.17'
20+
- name: Set release type environment
21+
run: |
22+
echo "RELEASE_TYPE=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
23+
- name: Check out polyglot
24+
uses: actions/checkout@v2
25+
with:
26+
repository: algolia/polyglot
27+
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
28+
- name: Install polyglot
29+
run: |
30+
make install
31+
export PATH="$GOPATH/bin:$PATH"
32+
- uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: '2.7.2'
35+
bundler-cache: true
36+
- uses: actions/checkout@v2
37+
- uses: maierj/[email protected]
38+
with:
39+
lane: 'deploy'
40+
options: '{ "type": "${{ env.RELEASE_TYPE }}" }'
41+

.github/workflows/lint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: SwiftLint
2+
on: [push]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v1
8+
- name: GitHub Action for SwiftLint with --strict
9+
uses: norio-nomura/[email protected]
10+
with:
11+
args: --strict

.github/workflows/pods.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Cocoapods
2+
on: [pull_request]
3+
jobs:
4+
lint:
5+
runs-on: macos-11
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Select Xcode version
9+
run: sudo xcode-select -s '/Applications/Xcode_13.2.app/Contents/Developer'
10+
- name: Pod lib lint
11+
run: pod lib lint

.github/workflows/swift.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Swift
2+
3+
on: [push]
4+
5+
jobs:
6+
test:
7+
runs-on: macos-11
8+
env:
9+
ALGOLIA_APPLICATION_ID_1: ${{ secrets.ALGOLIA_APPLICATION_ID_1 }}
10+
ALGOLIA_ADMIN_KEY_1: ${{ secrets.ALGOLIA_ADMIN_KEY_1 }}
11+
ALGOLIA_SEARCH_KEY_1: ${{ secrets.ALGOLIA_SEARCH_KEY_1 }}
12+
ALGOLIA_APPLICATION_ID_2: ${{ secrets.ALGOLIA_APPLICATION_ID_2 }}
13+
ALGOLIA_ADMIN_KEY_2: ${{ secrets.ALGOLIA_ADMIN_KEY_2 }}
14+
ALGOLIA_PLACES_APPLICATION_ID: ${{ secrets.ALGOLIA_PLACES_APPLICATION_ID }}
15+
ALGOLIA_PLACES_API_KEY: ${{ secrets.ALGOLIA_PLACES_API_KEY }}
16+
ALGOLIA_APPLICATION_ID_MCM: ${{ secrets.ALGOLIA_APPLICATION_ID_MCM }}
17+
ALGOLIA_ADMIN_KEY_MCM: ${{ secrets.ALGOLIA_ADMIN_KEY_MCM }}
18+
ALGOLIA_ANSWERS_APPLICATION_ID: ${{ secrets.ALGOLIA_ANSWERS_APPLICATION_ID }}
19+
ALGOLIA_ANSWERS_API_KEY: ${{ secrets.ALGOLIA_ANSWERS_API_KEY }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Select Xcode version
23+
run: sudo xcode-select -s '/Applications/Xcode_13.2.app/Contents/Developer'
24+
- name: Build project
25+
run: swift build
26+
- name: Run tests
27+
run: swift test

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ source "https://rubygems.org"
55
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
66

77
gem 'cocoapods', '~> 1.11'
8-
gem 'fastlane', '~> 2.195'
8+
gem 'fastlane', '~> 2.200'
99
gem 'xcov'

Gemfile.lock

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.4)
4+
CFPropertyList (3.0.5)
55
rexml
66
activesupport (6.1.4.1)
77
concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -17,23 +17,23 @@ GEM
1717
artifactory (3.0.15)
1818
atomos (0.1.3)
1919
aws-eventstream (1.2.0)
20-
aws-partitions (1.510.0)
21-
aws-sdk-core (3.121.1)
20+
aws-partitions (1.549.0)
21+
aws-sdk-core (3.125.3)
2222
aws-eventstream (~> 1, >= 1.0.2)
23-
aws-partitions (~> 1, >= 1.239.0)
23+
aws-partitions (~> 1, >= 1.525.0)
2424
aws-sigv4 (~> 1.1)
2525
jmespath (~> 1.0)
26-
aws-sdk-kms (1.49.0)
27-
aws-sdk-core (~> 3, >= 3.120.0)
26+
aws-sdk-kms (1.53.0)
27+
aws-sdk-core (~> 3, >= 3.125.0)
2828
aws-sigv4 (~> 1.1)
29-
aws-sdk-s3 (1.103.0)
30-
aws-sdk-core (~> 3, >= 3.120.0)
29+
aws-sdk-s3 (1.111.1)
30+
aws-sdk-core (~> 3, >= 3.125.0)
3131
aws-sdk-kms (~> 1)
3232
aws-sigv4 (~> 1.4)
3333
aws-sigv4 (1.4.0)
3434
aws-eventstream (~> 1, >= 1.0.2)
3535
babosa (1.0.4)
36-
claide (1.0.3)
36+
claide (1.1.0)
3737
cocoapods (1.11.2)
3838
addressable (~> 2.8)
3939
claide (>= 1.0.2, < 2.0)
@@ -86,17 +86,18 @@ GEM
8686
escape (0.0.4)
8787
ethon (0.14.0)
8888
ffi (>= 1.15.0)
89-
excon (0.86.0)
90-
faraday (1.8.0)
89+
excon (0.90.0)
90+
faraday (1.9.3)
9191
faraday-em_http (~> 1.0)
9292
faraday-em_synchrony (~> 1.0)
9393
faraday-excon (~> 1.1)
94-
faraday-httpclient (~> 1.0.1)
94+
faraday-httpclient (~> 1.0)
95+
faraday-multipart (~> 1.0)
9596
faraday-net_http (~> 1.0)
96-
faraday-net_http_persistent (~> 1.1)
97+
faraday-net_http_persistent (~> 1.0)
9798
faraday-patron (~> 1.0)
9899
faraday-rack (~> 1.0)
99-
multipart-post (>= 1.2, < 3)
100+
faraday-retry (~> 1.0)
100101
ruby2_keywords (>= 0.0.4)
101102
faraday-cookie_jar (0.0.7)
102103
faraday (>= 0.8.0)
@@ -105,14 +106,17 @@ GEM
105106
faraday-em_synchrony (1.0.0)
106107
faraday-excon (1.1.0)
107108
faraday-httpclient (1.0.1)
109+
faraday-multipart (1.0.3)
110+
multipart-post (>= 1.2, < 3)
108111
faraday-net_http (1.0.1)
109112
faraday-net_http_persistent (1.2.0)
110113
faraday-patron (1.0.0)
111114
faraday-rack (1.0.0)
112-
faraday_middleware (1.1.0)
115+
faraday-retry (1.0.3)
116+
faraday_middleware (1.2.0)
113117
faraday (~> 1.0)
114-
fastimage (2.2.5)
115-
fastlane (2.195.0)
118+
fastimage (2.2.6)
119+
fastlane (2.200.0)
116120
CFPropertyList (>= 2.3, < 4.0.0)
117121
addressable (>= 2.8, < 3.0.0)
118122
artifactory (~> 3.0)
@@ -155,7 +159,7 @@ GEM
155159
fourflusher (2.3.1)
156160
fuzzy_match (2.0.4)
157161
gh_inspector (1.1.3)
158-
google-apis-androidpublisher_v3 (0.11.0)
162+
google-apis-androidpublisher_v3 (0.15.0)
159163
google-apis-core (>= 0.4, < 2.a)
160164
google-apis-core (0.4.1)
161165
addressable (~> 2.5, >= 2.5.1)
@@ -166,27 +170,27 @@ GEM
166170
retriable (>= 2.0, < 4.a)
167171
rexml
168172
webrick
169-
google-apis-iamcredentials_v1 (0.7.0)
173+
google-apis-iamcredentials_v1 (0.10.0)
170174
google-apis-core (>= 0.4, < 2.a)
171-
google-apis-playcustomapp_v1 (0.5.0)
175+
google-apis-playcustomapp_v1 (0.7.0)
172176
google-apis-core (>= 0.4, < 2.a)
173-
google-apis-storage_v1 (0.8.0)
177+
google-apis-storage_v1 (0.11.0)
174178
google-apis-core (>= 0.4, < 2.a)
175179
google-cloud-core (1.6.0)
176180
google-cloud-env (~> 1.0)
177181
google-cloud-errors (~> 1.0)
178182
google-cloud-env (1.5.0)
179183
faraday (>= 0.17.3, < 2.0)
180184
google-cloud-errors (1.2.0)
181-
google-cloud-storage (1.34.1)
182-
addressable (~> 2.5)
185+
google-cloud-storage (1.36.0)
186+
addressable (~> 2.8)
183187
digest-crc (~> 0.4)
184188
google-apis-iamcredentials_v1 (~> 0.1)
185189
google-apis-storage_v1 (~> 0.1)
186190
google-cloud-core (~> 1.6)
187191
googleauth (>= 0.16.2, < 2.a)
188192
mini_mime (~> 1.0)
189-
googleauth (1.0.0)
193+
googleauth (1.1.0)
190194
faraday (>= 0.17.3, < 2.0)
191195
jwt (>= 1.4, < 3.0)
192196
memoist (~> 0.16)
@@ -199,12 +203,12 @@ GEM
199203
httpclient (2.8.3)
200204
i18n (1.8.10)
201205
concurrent-ruby (~> 1.0)
202-
jmespath (1.4.0)
203-
json (2.5.1)
206+
jmespath (1.5.0)
207+
json (2.6.1)
204208
jwt (2.3.0)
205209
memoist (0.16.2)
206210
mini_magick (4.11.0)
207-
mini_mime (1.1.1)
211+
mini_mime (1.1.2)
208212
minitest (5.14.4)
209213
molinillo (0.8.0)
210214
multi_json (1.15.0)
@@ -214,7 +218,7 @@ GEM
214218
naturally (2.2.1)
215219
netrc (0.11.0)
216220
optparse (0.1.1)
217-
os (1.1.1)
221+
os (1.1.4)
218222
plist (3.6.0)
219223
public_suffix (4.0.6)
220224
rake (13.0.6)
@@ -241,7 +245,7 @@ GEM
241245
terminal-notifier (2.0.0)
242246
terminal-table (1.8.0)
243247
unicode-display_width (~> 1.1, >= 1.1.1)
244-
trailblazer-option (0.1.1)
248+
trailblazer-option (0.1.2)
245249
tty-cursor (0.7.1)
246250
tty-screen (0.8.1)
247251
tty-spinner (0.9.3)
@@ -283,7 +287,7 @@ PLATFORMS
283287

284288
DEPENDENCIES
285289
cocoapods (~> 1.11)
286-
fastlane (~> 2.195)
290+
fastlane (~> 2.200)
287291
xcov
288292

289293
BUNDLED WITH

fastlane/Appfile

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

fastlane/Fastfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ lane :deploy do |options|
4949
podspec_path = "AlgoliaSearchClient.podspec"
5050
base_branch = options[:branch] || "master"
5151

52-
# ensure branch and cleaniness locally but not on Bitrise.
53-
if !ENV['BITRISE_BUILD_NUMBER']
52+
# ensure branch and cleaniness locally but not on CI.
53+
if !ENV['GITHUB_ACTION']
5454
ensure_git_branch(
5555
branch: base_branch
5656
)
@@ -82,6 +82,7 @@ lane :deploy do |options|
8282

8383
create_pull_request(
8484
repo: repository_name,
85+
api_token: ENV["GITHUB_PERSONAL_ACCESS_TOKEN"],
8586
title: "chore: Deploying new #{release_type} version #{new_version}",
8687
head: branch_name,
8788
base: base_branch,
@@ -90,7 +91,7 @@ lane :deploy do |options|
9091

9192
set_github_release(
9293
repository_name: repository_name,
93-
api_token: ENV["GITHUB_API_TOKEN"],
94+
api_token: ENV["GITHUB_PERSONAL_ACCESS_TOKEN"],
9495
name: new_version,
9596
tag_name: new_version,
9697
description: (File.read("../release_notes.md") rescue "No release notes provided"),

0 commit comments

Comments
 (0)