From e475701b21f1183bcdd0761243f43df7956780d1 Mon Sep 17 00:00:00 2001 From: Kristaps Grinbergs Date: Wed, 26 Sep 2018 22:16:44 +0300 Subject: [PATCH 1/4] Release automatization Fixes #8 --- Gemfile | 5 ++ Gemfile.lock | 148 ++++++++++++++++++++++++++++++++++++++++++++++ deploy.sh | 3 + fastlane/Fastfile | 22 +++++++ 4 files changed, 178 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100755 deploy.sh create mode 100644 fastlane/Fastfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..e0d5a6d --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gem "fastlane" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..ea8eff2 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,148 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.0) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + atomos (0.1.3) + babosa (1.0.2) + claide (1.0.2) + colored (1.2) + colored2 (3.1.2) + commander-fastlane (4.4.6) + highline (~> 1.7.2) + declarative (0.0.10) + declarative-option (0.1.0) + domain_name (0.5.20180417) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.5.0) + emoji_regex (0.1.1) + excon (0.62.0) + faraday (0.15.3) + multipart-post (>= 1.2, < 3) + faraday-cookie_jar (0.0.6) + faraday (>= 0.7.4) + http-cookie (~> 1.0.0) + faraday_middleware (0.12.2) + faraday (>= 0.7.4, < 1.0) + fastimage (2.1.4) + fastlane (2.105.2) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.3, < 3.0.0) + babosa (>= 1.0.2, < 2.0.0) + bundler (>= 1.12.0, < 2.0.0) + colored + commander-fastlane (>= 4.4.6, < 5.0.0) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (~> 0.1) + excon (>= 0.45.0, < 1.0.0) + faraday (~> 0.9) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 0.9) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-api-client (>= 0.21.2, < 0.24.0) + highline (>= 1.7.2, < 2.0.0) + json (< 3.0.0) + mini_magick (~> 4.5.1) + multi_json + multi_xml (~> 0.5) + multipart-post (~> 2.0.0) + plist (>= 3.1.0, < 4.0.0) + public_suffix (~> 2.0.0) + rubyzip (>= 1.2.2, < 2.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + slack-notifier (>= 2.0.0, < 3.0.0) + terminal-notifier (>= 1.6.2, < 2.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.6.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + gh_inspector (1.1.3) + google-api-client (0.23.9) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.5, < 0.7.0) + httpclient (>= 2.8.1, < 3.0) + mime-types (~> 3.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + signet (~> 0.9) + googleauth (0.6.6) + faraday (~> 0.12) + jwt (>= 1.4, < 3.0) + memoist (~> 0.12) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (~> 0.7) + highline (1.7.10) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + json (2.1.0) + jwt (2.1.0) + memoist (0.16.0) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2018.0812) + mini_magick (4.5.1) + multi_json (1.13.1) + multi_xml (0.6.0) + multipart-post (2.0.0) + nanaimo (0.2.6) + naturally (2.2.0) + os (1.0.0) + plist (3.4.0) + public_suffix (2.0.5) + representable (3.0.4) + declarative (< 0.1.0) + declarative-option (< 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rouge (2.0.7) + rubyzip (1.2.2) + security (0.1.3) + signet (0.10.0) + addressable (~> 2.3) + faraday (~> 0.9) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.5) + CFPropertyList + naturally + slack-notifier (2.3.2) + terminal-notifier (1.8.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + tty-cursor (0.6.0) + tty-screen (0.6.5) + tty-spinner (0.8.0) + tty-cursor (>= 0.5.0) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.5) + unicode-display_width (1.4.0) + word_wrap (1.0.0) + xcodeproj (1.6.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.6) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.0) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + fastlane + +BUNDLED WITH + 1.16.4 diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..4ecf9c4 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +bundle exec fastlane release diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..435f6f7 --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,22 @@ +default_platform(:ios) + +update_fastlane + +platform :ios do + desc "Depoy new version" + lane :release do + ensure_git_branch + version = version_get_podspec(path: "NSObject+Rx.podspec") + changelog = prompt(text: "Changelog: ", multi_line_end_keyword: "END") + github_release = set_github_release( + repository_name: "RxSwiftCommunity/NSObject-Rx", + api_token: ENV['GITHUB_TOKEN'], + name: version, + tag_name: version, + description: changelog, + commitish: "master" + ) + sh("git fetch --tags") + pod_push(allow_warnings: true, verbose: true) + end +end From 7173afc40f846dae93ebb3d198007101ff3aa9c8 Mon Sep 17 00:00:00 2001 From: Kristaps Grinbergs Date: Wed, 26 Sep 2018 22:56:39 +0300 Subject: [PATCH 2/4] Adjust the github token getting --- Gemfile | 2 -- deploy.sh | 2 ++ fastlane/Fastfile | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index e0d5a6d..7a118b4 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,3 @@ -# frozen_string_literal: true - source "https://rubygems.org" gem "fastlane" diff --git a/deploy.sh b/deploy.sh index 4ecf9c4..a8c5474 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,3 +1,5 @@ #!/bin/bash +# export GITHUB_TOKEN="" + bundle exec fastlane release diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 435f6f7..bf729bc 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -8,9 +8,15 @@ platform :ios do ensure_git_branch version = version_get_podspec(path: "NSObject+Rx.podspec") changelog = prompt(text: "Changelog: ", multi_line_end_keyword: "END") + + github_token = ENV['GITHUB_TOKEN'] + if !github_token || github_token.empty? + github_token = prompt(text: "Please enter your GitHub token: ") + end + github_release = set_github_release( repository_name: "RxSwiftCommunity/NSObject-Rx", - api_token: ENV['GITHUB_TOKEN'], + api_token: github_token, name: version, tag_name: version, description: changelog, From 31ade5d3ac87d38cc515272c7d8cc6977373483c Mon Sep 17 00:00:00 2001 From: Kristaps Grinbergs Date: Wed, 26 Sep 2018 22:57:29 +0300 Subject: [PATCH 3/4] Add fastlane files to .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1b5da82..13d6044 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ Carthage/ # MacOS # .DS_Store + +fastlane/README.md +fastlane/report.xml From 92e08a03b268df9231a59cfe0e681096c2582efe Mon Sep 17 00:00:00 2001 From: Kristaps Grinbergs Date: Wed, 26 Sep 2018 22:58:16 +0300 Subject: [PATCH 4/4] Remove github token setting in bash script --- deploy.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/deploy.sh b/deploy.sh index a8c5474..4ecf9c4 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,3 @@ #!/bin/bash -# export GITHUB_TOKEN="" - bundle exec fastlane release