fastlane-plugin-sunny_project 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ce12ef710c532d745039014df9970dd64a5b0a3d76392ebe5feb7e84b0ae445
4
- data.tar.gz: c4f5efa01f1c70f7f6ab043855e0f2c51f65611f75eab66d7ce04abb053c775d
3
+ metadata.gz: 42911dd4d19f1f6d97f8a405a4fd77297f9cbaa4bb3799f4aeea86171c7e4937
4
+ data.tar.gz: 41feddd1a00ba67e10a18330bed8561b9ebccf52c26c606b2806ef9298fc34af
5
5
  SHA512:
6
- metadata.gz: e6037740092fe97afd89e55a50fbc288005950495c4c4605fb0564aab0fb704cdb7f70aa5d772d1b57a5bd5fff3248616ee4ddd1a14d490b8713bce25e7aa9f3
7
- data.tar.gz: 0653c4a208fddb510fe77e6fd6bacdbba167399ee07286f1a3586ba8ed29b040ff4a31509490830c08b9c613c0780eb45e38c9e3a5cea5b47604cccd6354229c
6
+ metadata.gz: 9f01acd98e752ed2d5a2d55574bb6e5cd6730ff83a679c9a1a476871a29781dab9be46b5fb367f790ed3f09821a1001957de22c8a02e3e6b4891ee8adb6de2cb
7
+ data.tar.gz: 9d3fa97eb577500c022baced2c03e5f5ed6be59a827d1f2303a1133f162b25f413fd846ee80a8d13f10ade62812d74ee788f0b1c8a8948b725bfb4f57f5fbe06
@@ -5,21 +5,7 @@ module Fastlane
5
5
  module Actions
6
6
  class FinalizeVersionAction < Action
7
7
  def self.run(options)
8
- version = Sunny.current_semver
9
- # If we got this far, let's commit the build number and update the git tags. If the rest of the pro
10
- # process fails, we should revert this because it will mess up our commit logs
11
- Sunny.run_action(GitCommitAction, path: %w[./pubspec.yaml ./pubspec.lock ./CHANGELOG.md],
12
- allow_nothing_to_commit: true,
13
- message: "Version bump to: #{version.major}.#{version.minor}.#{version.patch}#800#{version.build}")
14
- Sunny.run_action(AddGitTagAction,
15
- tag: "sunny/builds/v#{version.build}",
16
- force: true,
17
- sign: false,
18
- )
19
- Sunny.run_action(PushGitTagsAction, force: true)
20
- if File.exist?(Sunny.release_notes_file)
21
- File.delete(Sunny.release_notes_file)
22
- end
8
+ Sunny.finalize_version(options)
23
9
  end
24
10
 
25
11
  def self.description
@@ -40,15 +26,15 @@ module Fastlane
40
26
  end
41
27
 
42
28
  def self.available_options
43
- [
29
+ [
44
30
  FastlaneCore::ConfigItem.new(key: :tag_group,
45
31
  env_name: "SUNNY_PROJECT_TAG_GROUP",
46
32
  description: "The name of the tag group",
47
33
  optional: false,
48
34
  type: String,
49
35
  default_value: "sunny/builds"),
36
+ ]
50
37
 
51
- ]
52
38
  end
53
39
 
54
40
  def self.is_supported?(platform)
@@ -0,0 +1,68 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/sunny_project_helper'
3
+ require 'semantic'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class PubReleaseAction < Action
8
+ def self.run(options)
9
+ unless options[:skip_dirty_check]
10
+ Sunny.run_action(EnsureGitStatusCleanAction)
11
+ end
12
+
13
+ Sunny.do_increase_version(options)
14
+ # Whatever happened with the incrementing, this is the build number we're
15
+ # going with
16
+ changes = Sunny.release_notes(options)
17
+ puts(changes)
18
+
19
+ Sunny.exec_cmd("pub publish", "pub publish -f")
20
+ Sunny.finalize_version(options)
21
+ end
22
+
23
+ def self.description
24
+ "Releases a dart package"
25
+ end
26
+
27
+ def self.authors
28
+ ["ericmartineau"]
29
+ end
30
+
31
+ def self.return_value
32
+ # If your method provides a return value, you can describe here what it does
33
+ end
34
+
35
+ def self.details
36
+ # Optional:
37
+ ""
38
+ end
39
+
40
+ def self.available_options
41
+ opts = [
42
+ FastlaneCore::ConfigItem.new(key: :skip_dirty_check,
43
+ description: "Whether to skip dirty repo check",
44
+ optional: true, type: Object),
45
+
46
+ ]
47
+ Fastlane::Actions::FinalizeVersionAction.available_options.each do |option|
48
+ opts.push(option)
49
+ end
50
+ Fastlane::Actions::IncreaseVersionAction.available_options.each do |option|
51
+ opts.push(option)
52
+ end
53
+ Fastlane::Actions::ReleaseNotesAction.available_options.each do |option|
54
+ opts.push(option)
55
+ end
56
+ opts
57
+ end
58
+
59
+ def self.is_supported?(platform)
60
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
61
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
62
+ #
63
+ # [:ios, :mac, :android].include?(platform)
64
+ true
65
+ end
66
+ end
67
+ end
68
+ end
@@ -8,7 +8,7 @@ module Fastlane
8
8
 
9
9
  class ReleaseNotesAction < Action
10
10
  def self.run(options)
11
-
11
+ Sunny.release_notes(options)
12
12
  end
13
13
 
14
14
  def self.description
@@ -30,7 +30,7 @@ module Fastlane
30
30
 
31
31
  def self.available_options
32
32
  [
33
- FastlaneCore::ConfigItem.new(key: :changes,
33
+ FastlaneCore::ConfigItem.new(key: :changelog,
34
34
  env_name: "SUNNY_PROJECT_CHANGES",
35
35
  description: "Change log text",
36
36
  optional: true,
@@ -49,10 +49,13 @@ module Fastlane
49
49
  if (not options[:skip_build]) && (not options[:no_bump])
50
50
  if options[:patch]
51
51
  new_version = Sunny.do_increase_version(type: "patch")
52
+ Sunny.update_ios_project_version(new_version)
52
53
  elsif options[:minor]
53
54
  new_version = Sunny.do_increase_version(type: "minor")
55
+ Sunny.update_ios_project_version(new_version)
54
56
  elsif options[:build]
55
57
  new_version = Sunny.do_increase_version(type: "build")
58
+ Sunny.update_ios_project_version(new_version)
56
59
  else
57
60
  UI.user_error!("You must provide the type of version change. options are minor, patch, build.
58
61
  You can also provide no_bump:true to keep the same build number")
@@ -64,6 +67,8 @@ You can also provide no_bump:true to keep the same build number")
64
67
  end
65
68
  end
66
69
 
70
+
71
+
67
72
  # Whatever happened with the incrementing, this is the build number we're
68
73
  # going with
69
74
  version = new_version
@@ -44,6 +44,10 @@ module Fastlane
44
44
  action.run(self.config(action.available_options, options))
45
45
  end
46
46
 
47
+ def self.mmp(semver)
48
+ "#{semver.major}.#{semver.minor}.#{semver.patch}"
49
+ end
50
+
47
51
  def self.do_increase_version(options)
48
52
  bump_type = options[:type]
49
53
  bump_type = "build" unless bump_type
@@ -60,6 +64,14 @@ module Fastlane
60
64
  self.current_semver
61
65
  end
62
66
 
67
+ def self.update_ios_project_version(new_version)
68
+ Dir.chdir("ios") {
69
+ puts("Updating XCode Project files: version:#{mmp(new_version)}, build: #{new_version.build}")
70
+ self.run_action(Fastlane::Actions::IncrementVersionNumberAction, version_number: mmp(new_version))
71
+ self.run_action(Fastlane::Actions::IncrementBuildNumberAction, build_number: new_version.build)
72
+ }
73
+ end
74
+
63
75
  def self.config_to_hash(options)
64
76
  hash = Hash([])
65
77
  options.all_keys.each do |key|
@@ -106,6 +118,26 @@ module Fastlane
106
118
  Semantic::Version.new(current_version_string)
107
119
  end
108
120
 
121
+ def self.finalize_version(options)
122
+ version = self.current_semver
123
+ # If we got this far, let's commit the build number and update the git tags. If the rest of the pro
124
+ # process fails, we should revert this because it will mess up our commit logs
125
+ self.run_action(Fastlane::Actions::GitAddAction, path: %w[./pubspec.yaml ./pubspec.lock ./CHANGELOG.md])
126
+ self.run_action(Fastlane::Actions::GitCommitAction, path: %w[./pubspec.yaml ./pubspec.lock ./CHANGELOG.md],
127
+ allow_nothing_to_commit: false,
128
+
129
+ message: "Version bump to: #{version.major}.#{version.minor}.#{version.patch}#800#{version.build}")
130
+ self.run_action(Fastlane::Actions::AddGitTagAction,
131
+ tag: "sunny/builds/v#{version.build}",
132
+ force: true,
133
+ sign: false,
134
+ )
135
+ self.run_action(Fastlane::Actions::PushGitTagsAction, force: true)
136
+ if File.exist?(self.release_notes_file)
137
+ File.delete(self.release_notes_file)
138
+ end
139
+ end
140
+
109
141
  def self.release_notes(options)
110
142
  changes = Sunny.string(options[:changelog])
111
143
  if Sunny.blank(changes)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SunnyProject
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-sunny_project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ericmartineau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-19 00:00:00.000000000 Z
11
+ date: 2021-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -152,6 +152,7 @@ files:
152
152
  - lib/fastlane/plugin/sunny_project/actions/increase_version_action.rb
153
153
  - lib/fastlane/plugin/sunny_project/actions/local_packages_action.rb
154
154
  - lib/fastlane/plugin/sunny_project/actions/pub_publish_action.rb
155
+ - lib/fastlane/plugin/sunny_project/actions/pub_release_action.rb
155
156
  - lib/fastlane/plugin/sunny_project/actions/pubspec_doctor_action.rb
156
157
  - lib/fastlane/plugin/sunny_project/actions/release_notes_action.rb
157
158
  - lib/fastlane/plugin/sunny_project/actions/rename_assets_action.rb