-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbitrise.yml
169 lines (157 loc) · 5.85 KB
/
bitrise.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
format_version: "4"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: macos
app:
envs:
- BITRISE_PROJECT_PATH: Frisbee.xcodeproj
opts:
is_expand: false
- BITRISE_SCHEME: Frisbee-Package
opts:
is_expand: false
- BITRISE_EXPORT_METHOD: none
opts:
is_expand: false
trigger_map:
- push_branch: '*'
workflow: primary
- pull_request_source_branch: '*'
workflow: primary
workflows:
_start:
steps:
- script:
title: Swift Tests - Without Coverage!
inputs:
- content: swift test --parallel
_submit:
steps:
- script@1.1.5:
title: Commit Frisbee.plist
inputs:
- content: |-
git add Frisbee.plist
git commit -m "Update Frisbee.plist to $FRISBEE_VERSION [skip ci]"
- script@1.1.5:
title: Update README.md
inputs:
- content: |-
file=README.md
old_value="[0-9]+\.[0-9]+\.[0-9]+"
sed -E "s/$old_value/$FRISBEE_VERSION/g" "$file" > "$file.new" && mv "$file.new" "$file"
git add README.md
git commit -m "Update README.md to reference $FRISBEE_VERSION [skip ci]"
- script:
title: Create Release
inputs:
- is_debug: "yes"
- content: |-
curl -X "POST" "https://api.github.com/repos/ronanrodrigo/Frisbee/releases" \
-H 'Content-Type: application/json' \
-u "ronanrodrigo:${GITHUB_OAUTH_TOKEN}" \
-d "{\"body\": \"Description of the release\", \"draft\": false, \"tag_name\": \"${FRISBEE_VERSION}\", \"target_commitish\": \"master\", \"name\": \"${FRISBEE_VERSION}\", \"prerelease\": false}"
- cache-pull: {}
- script:
title: Submit Cocoapod
inputs:
- content: |-
cat > Frisbee.podspec <<- EOM
Pod::Spec.new do |s|
s.name = "Frisbee"
s.version = "$FRISBEE_VERSION"
s.summary = "Another network wrapper for URLSession"
s.description = "Built to make it easy to create tests for your application's network layer."
s.homepage = "https://github.com/ronanrodrigo/Frisbee"
s.license = {:type => "MIT", :file => "LICENSE"}
s.author = {"Ronan Rodrigo Nunes" => "ronan.nunes@me.com"}
s.social_media_url = "https://twitter.com/ronanrodrigo_"
s.ios.deployment_target = "10.0"
s.osx.deployment_target = "10.13"
s.source = { :git => "https://github.com/ronanrodrigo/Frisbee.git", :tag => "#{s.version}" }
s.source_files = "Sources/**/*.{swift}"
s.exclude_files = "Tests"
end
EOM
bundle install
bundle exec pod trunk push Frisbee.podspec
git add Frisbee.podspec
git commit -m "Update Frisbee.podspec to $FRISBEE_VERSION [skip ci]"
- script:
title: Set GEM_HOME env var
inputs:
- content: |-
#!/bin/bash
set -ev
envman add --key GEM_HOME --value "$(gem environment gemdir)"
- cache-push:
inputs:
- cache_paths: $GEM_HOME
- script:
title: Push to Master
inputs:
- content: git push origin master
- script:
title: Push Notification
inputs:
- content: 'curl -X POST -H "Content-Type: application/json" -d "{\"value1\":\"${FRISBEE_VERSION}\"}"
https://maker.ifttt.com/trigger/frisbee_deployed/with/key/$IFTTT_TOKEN'
deploy-major:
before_run:
- _start
after_run:
- _submit
steps:
- script:
title: Update version Frisbee.plist
inputs:
- content: |-
minor_version=0
patch_version=0
current_major_version=$( /usr/libexec/PlistBuddy -c "Print :Major" Frisbee.plist )
major_version=$(( $current_major_version + 1 ))
/usr/libexec/PlistBuddy -c "Set :Major ${major_version}" Frisbee.plist
/usr/libexec/PlistBuddy -c "Set :Minor ${minor_version}" Frisbee.plist
/usr/libexec/PlistBuddy -c "Set :Patch ${patch_version}" Frisbee.plist
envman add --key FRISBEE_VERSION --value "${major_version}.${minor_version}.${patch_version}"
deploy-minor:
before_run:
- _start
after_run:
- _submit
steps:
- script:
title: Update version Frisbee.plist
inputs:
- content: |-
major_version=$( /usr/libexec/PlistBuddy -c "Print :Major" Frisbee.plist )
patch_version=0
current_minor_version=$( /usr/libexec/PlistBuddy -c "Print :Minor" Frisbee.plist )
minor_version=$(( $current_minor_version + 1 ))
/usr/libexec/PlistBuddy -c "Set :Minor ${minor_version}" Frisbee.plist
/usr/libexec/PlistBuddy -c "Set :Patch ${patch_version}" Frisbee.plist
envman add --key FRISBEE_VERSION --value "${major_version}.${minor_version}.${patch_version}"
deploy-patch:
before_run:
- _start
after_run:
- _submit
steps:
- script:
title: Update version Frisbee.plist
inputs:
- content: |-
major_version=$( /usr/libexec/PlistBuddy -c "Print :Major" Frisbee.plist )
minor_version=$( /usr/libexec/PlistBuddy -c "Print :Minor" Frisbee.plist )
current_patch_version=$( /usr/libexec/PlistBuddy -c "Print :Patch" Frisbee.plist )
patch_version=$(( $current_patch_version + 1 ))
/usr/libexec/PlistBuddy -c "Set :Patch ${patch_version}" Frisbee.plist
envman add --key FRISBEE_VERSION --value "${major_version}.${minor_version}.${patch_version}"
primary:
steps:
- xcode-test-mac:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- codecov:
inputs:
- CODECOV_TOKEN: $CODECOV_TOKEN