forked from bitrise-io/codesigndoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
181 lines (170 loc) · 5.52 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
170
171
172
173
174
175
176
177
178
179
180
181
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
app:
envs:
- BITRISE_BIN_NAME: codesigndoc
- GITHUB_RELEASES_URL: https://github.com/bitrise-tools/${BITRISE_BIN_NAME}/releases
workflows:
_install_test_tools:
steps:
- script:
title: Install required testing tools
inputs:
- content: |-
#!/bin/bash
set -ex
# Check for unhandled errors
go get -u github.com/kisielk/errcheck
# Go lint
go get -u github.com/golang/lint/golint
_test:
steps:
- script:
title: GOLIST_WITHOUT_VENDOR
inputs:
- content: |-
set -ex
no_vendor_paths="$(go list ./... | grep -v vendor)"
envman add --key GOLIST_WITHOUT_VENDOR --value "$no_vendor_paths"
- script:
title: Go Test
inputs:
- content: |-
#!/bin/bash
set -ex
go test $GOLIST_WITHOUT_VENDOR
- script:
title: Err check
inputs:
- content: |-
#!/bin/bash
set -ex
errcheck -asserts=true -blank=true $GOLIST_WITHOUT_VENDOR
- script:
title: Go Lint
inputs:
- content: |-
#!/bin/bash
set -e
while read -r line; do
echo "-> Linting: $line"
golint_out="$(golint $line)"
if [[ "${golint_out}" != "" ]] ; then
echo "=> Golint issues found:"
echo "${golint_out}"
exit 1
fi
done <<< "$GOLIST_WITHOUT_VENDOR"
install:
before_run:
- _test
steps:
- script:
title: Test & install
inputs:
- content: |-
#!/bin/bash
set -ex
go install
dep-update:
title: Dep update
description: |
Used for updating bitrise dependencies with dep
steps:
- script:
title: Dependency update
inputs:
- content: |-
#!/bin/bash
set -ex
go get -u -v github.com/golang/dep/cmd/dep
dep ensure -v
dep ensure -v -update
ci:
before_run:
- _install_test_tools
- _test
steps:
- slack:
run_if: .IsCI
inputs:
- webhook_url: $INTERNAL_DEV_SLACK_WEBHOOK_URL
- channel: $INTERNAL_DEV_SLACK_CHANNEL
- from_username: ${BITRISE_BIN_NAME} - CI - OK
- from_username_on_error: ${BITRISE_BIN_NAME} - CI - ERROR
- emoji: ":white_check_mark:"
- emoji_on_error: ":no_entry_sign:"
- message: |-
CI was successful on branch: *${BITRISE_GIT_BRANCH}*
Build URL: ${BITRISE_BUILD_URL}
- message_on_error: |-
CI FAILED on branch: *${BITRISE_GIT_BRANCH}*
Build URL: ${BITRISE_BUILD_URL}
create-release:
before_run:
- _test
steps:
- script:
title: Creating deploy
inputs:
- content: |-
#!/bin/bash
set -ex
if [ -f _bin/tmpbin ] ; then
rm _bin/tmpbin
fi
go build -o _bin/tmpbin
binversion="$(_bin/tmpbin version)"
echo "binversion: ${binversion}"
mkdir -p _bin/${binversion}
finalpth=_bin/${binversion}/${BITRISE_BIN_NAME}-$(uname -s)-$(uname -m)
echo "finalpth: ${finalpth}"
mv _bin/tmpbin "${finalpth}"
# register the version for next steps
envman add --key RELEASE_VERSION --value "${binversion}"
# generate changelog
releaseman create-changelog --version "${binversion}"
- script:
title: Creating release install_wrap
inputs:
- content: |-
template_path = "./_scripts/install_wrap.sh.template"
puts " * template_path: #{template_path}"
template_content = File.read(template_path)
# -- xcode --
target_path = "./_scripts/install_wrap-xcode.sh"
puts " * target_path: #{target_path}"
final_content = template_content.gsub("{{version}}", ENV['RELEASE_VERSION'])
final_content = final_content.gsub("{{scan_cmd}}", 'xcode')
File.open(target_path, "w") do |f|
f.write(final_content)
end
# for compatibility
File.open("./_scripts/install_wrap.sh", "w") do |f|
f.write(final_content)
end
# -- xamarin --
target_path = "./_scripts/install_wrap-xamarin.sh"
puts " * target_path: #{target_path}"
final_content = template_content.gsub("{{version}}", ENV['RELEASE_VERSION'])
final_content = final_content.gsub("{{scan_cmd}}", 'xamarin')
File.open(target_path, "w") do |f|
f.write(final_content)
end
- runner_bin: ruby
# - script:
# title: Creating release changelog template
# inputs:
# - content: |-
# changelog_path = "./_changelogs/#{ENV['RELEASE_VERSION']}.md"
# puts " * changelog_path: #{changelog_path}"
# template_content = File.read("./_changelogs/template.md")
# changelog_content = template_content.gsub("{{version}}", ENV['RELEASE_VERSION'])
# File.open(changelog_path, "w") do |f|
# f.write(changelog_content)
# end
# - runner_bin: ruby
# - script:
# title: Open _bin folder
# inputs:
# - content: open _bin