-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathFastfile
84 lines (64 loc) · 2.02 KB
/
Fastfile
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
# Customise this file, documentation can be found here:
# https://github.com/KrauseFx/fastlane/tree/master/docs
# All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md
# can also be listed using the `fastlane actions` command
# If you want to automatically update fastlane if a new version is available:
update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version "1.24.0"
# -----------
def project_name
"XcodeServerSDK"
end
def project_github_name
"czechboy0/#{project_name}"
end
def release_branch
"master"
end
# -----------
lane :prebuild do
cocoapods
end
lane :release do
# prep the local state
ensure_git_status_clean
ensure_git_branch(branch: release_branch)
git_pull
# lint podspec first
sh "cd .. && pod lib lint"
# regen the changelog and open it
sh "cd .. && github_changelog_generator -t $GITHUB_TOKEN && subl CHANGELOG.md"
# assume version from the podspec
version = read_podspec['source']['tag']
# ask for info
title = prompt(text: 'Release Title: ')
description = prompt(text: "Release changelog: ",
multi_line_end_keyword: "END")
# create a new release on GitHub
repo_url = project_github_name
ENV["FL_GITHUB_RELEASE_API_TOKEN"] = ENV["GITHUB_TOKEN"]
release = set_github_release(
repository_name: repo_url,
commitish: release_branch,
name: [version, title].join(" - "),
tag_name: version,
description: description,
is_draft: false,
is_prerelease: false
)
# release podspec to cocoapods
sh "cd .. && pod trunk push"
# notify us on slack
# slack(
# slack_url: ENV['SLACK_RELEASES_URL'],
# message: "Successfully released [#{project_name} #{version}](#{release['html_url']}) :rocket:",
# payload: {
# "New" => release['body']
# }
# )
# regenerate changelog to get it committed
sh "cd .. && github_changelog_generator -t $GITHUB_TOKEN"
sh "cd .. && git commit -am \"changelog\" && git push"
end