Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .shiprc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files": {
"Auth0UniversalComponents/Version.swift": [],
"README.md": ["from: \"{MAJOR}.{MINOR}.{PATCH}\""]
},
"postbump": "bundle update && bundle exec fastlane ios build_docs",
"prefixVersion": false
}
30 changes: 27 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
default_platform :ios

platform :ios do
desc "Tags the release and publishes to GitHub"
desc "Tags the release and publishes it to GitHub (no CocoaPods)"
lane :release do
perform_release target: 'Auth0UniversalComponents.iOS'
publish_release repository: 'ui-components-ios'
version = current_version
UI.header "Performing release for version #{version} 🏗"
add_git_tag(tag: version)
push_git_tags(remote: 'origin', tag: version)

UI.header "Publishing release #{version} 📨"
github_token = ENV['GITHUB_TOKEN'] || ENV['AUTH0_SHIPPER_GITHUB_TOKEN']
changelog = Fastlane::Helper::Auth0ShipperHelper.get_changelog(version, 'CHANGELOG.md')
set_github_release(
repository_name: 'auth0/ui-components-ios',
api_token: github_token,
name: version,
tag_name: version,
description: changelog,
server_url: 'https://api.github.com'
) unless github_token.nil?
UI.success "Shipped #{version}! 🚀"
end

desc 'Generate API documentation'
Expand Down Expand Up @@ -34,4 +49,13 @@ platform :ios do
File.write("#{docs_dir}/index.html", redirect_file)
end
end

# Reads the SDK version from the `version` literal in Version.swift,
# which is the source of truth bumped by Ship (see .shiprc).
def current_version
contents = File.read(File.join(File.dirname(__FILE__), '..', 'Auth0UniversalComponents', 'Version.swift'))
match = contents.match(/let version = "([^"]+)"/)
UI.user_error!('Cannot find version in Auth0UniversalComponents/Version.swift') if match.nil?
match[1]
end
end
2 changes: 1 addition & 1 deletion fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do
[bundle exec] fastlane ios release
```

Tags the release and pushes the Podspec to CocoaPods
Tags the release and publishes it to GitHub (no CocoaPods)

### ios build_docs

Expand Down
Loading