Skip to content

Commit b44b2fe

Browse files
authored
Merge branch 'trunk' into remove/drawtext-as-direct-dependency
2 parents 1201ab4 + 6cde866 commit b44b2fe

20 files changed

+393
-66
lines changed

.buildkite/pipeline.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ steps:
1919
# Build and Test
2020
#################
2121
- label: "🧪 Build and Test"
22-
key: "test"
22+
key: test
2323
command: |
2424
# We only need this for tasks running on a Mac
2525
brew install pkg-config git-lfs libxml2 imagemagick@6
@@ -35,14 +35,15 @@ steps:
3535
env:
3636
IMAGE_ID: xcode-12.5.1
3737
plugins:
38-
automattic/bash-cache#v1.3.2: ~
38+
automattic/bash-cache#2.0.0: ~
3939
agents:
4040
queue: "mac"
4141

4242
#################
4343
# Lint
4444
#################
45-
- label: "🧹 Lint"
45+
- label: "🧹 Lint (Rubocop)"
46+
key: rubocop
4647
command: |
4748
bundle install
4849
echo "--- :rubocop: Run Rubocop"
@@ -55,6 +56,7 @@ steps:
5556
# Danger
5657
#################
5758
- label: "⛔️ Danger"
59+
key: danger
5860
command: |
5961
bundle install
6062
echo "--- :rubocop: Run Danger"
@@ -69,6 +71,10 @@ steps:
6971
- label: ":rubygems: Publish to RubyGems"
7072
key: "gem-push"
7173
if: build.tag != null
74+
depends_on:
75+
- test
76+
- rubocop
77+
- danger
7278
# Note: We intentionally call a separate `.sh` script here (as opposed to having all the
7379
# commands written inline) to avoid leaking a key used in the process in clear in the
7480
# BUILDKITE_COMMAND environment variable.

.rubocop_todo.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,3 +482,7 @@ Style/ZeroLengthPredicate:
482482
- 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/add_devices_to_provisioning_profiles.rb'
483483
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb'
484484
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb'
485+
486+
Style/ClassVars:
487+
Exclude:
488+
- 'lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb'

CHANGELOG.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,35 @@
1010

1111
### New Features
1212

13-
* Added a new `ios_generate_strings_file_from_code` action to replace the now-deprecated `ios_localize_project` action (and `Scripts/localize.py` script in app repos). [#309, #311]
13+
_None_
1414

1515
### Bug Fixes
1616

1717
_None_
1818

1919
### Internal Changes
2020

21-
_None_
21+
* Ensure that the `gem push` step only runs on CI if lint, test and danger steps passed before it. [#325]
22+
23+
## 2.3.0
24+
25+
### New Features
26+
27+
* Added parameter for default/base branch across several actions [#319]
28+
29+
## 2.2.0
30+
31+
### New Features
32+
33+
* Added a new `ios_generate_strings_file_from_code` action to replace the now-deprecated `ios_localize_project` action (and `Scripts/localize.py` script in app repos). [#309, #311]
34+
* Added a `comment_on_pr` action to allow commenting on (and updating comments on) PRs. [#313]
35+
* Added the ability to use the `GITHUB_TOKEN` environment variable for GitHub operations. `GHHELPER_ACCESS` will be deprecated in a future version. [#313]
36+
* Added support for downloading GitHub content for private repositories [#321]
37+
38+
### Bug Fixes
39+
40+
* Fixed the rendering of PR links in the body of GitHub Releases created via the `create_release` action. [#316]
41+
* Fixed a bug introduced in [#313] that caused the GitHub helper not to work [#318]
2242

2343
## 2.1.0
2444

Gemfile.lock

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
fastlane-plugin-wpmreleasetoolkit (2.1.0)
4+
fastlane-plugin-wpmreleasetoolkit (2.3.0)
55
activesupport (~> 5)
66
bigdecimal (~> 1.4)
77
chroma (= 0.2.0)
@@ -267,7 +267,6 @@ GEM
267267
method_source (0.9.2)
268268
mini_magick (4.11.0)
269269
mini_mime (1.1.2)
270-
mini_portile2 (2.6.1)
271270
minitest (5.14.4)
272271
molinillo (0.8.0)
273272
multi_json (1.15.0)
@@ -277,8 +276,7 @@ GEM
277276
naturally (2.2.1)
278277
netrc (0.11.0)
279278
no_proxy_fix (0.1.2)
280-
nokogiri (1.12.5)
281-
mini_portile2 (~> 2.6.1)
279+
nokogiri (1.12.5-x86_64-darwin)
282280
racc (~> 1.4)
283281
octokit (4.21.0)
284282
faraday (>= 0.9)
@@ -426,4 +424,4 @@ DEPENDENCIES
426424
yard
427425

428426
BUNDLED WITH
429-
2.2.31
427+
2.2.33

Rakefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ task :new_release do
6262
Console.header 'Commit and push changes...'
6363
GitHelper.commit_files("Bumped to version #{new_version}", [VERSION_FILE, 'Gemfile.lock', 'CHANGELOG.md'])
6464

65-
Console.header 'Opening PR drafts in your default browser...'
66-
GitHelper.prepare_github_pr("release/#{new_version}", 'develop', "Release #{new_version} into develop", "New version #{new_version}")
65+
Console.header 'Opening PR draft in your default browser...'
6766
GitHelper.prepare_github_pr("release/#{new_version}", 'trunk', "Release #{new_version} into trunk", "New version #{new_version}. Be sure to create a GitHub Release and tag once this PR gets merged.")
6867

6968
Console.info <<~INSTRUCTIONS
@@ -72,8 +71,8 @@ task :new_release do
7271
7372
>>> WHAT'S NEXT
7473
75-
1. Create PRs to `develop` and `trunk`.
76-
2. Once the PRs are merged, publish a GitHub release for \`#{new_version}\`, targeting \`trunk\`,
74+
1. Create a PR against `trunk`.
75+
2. Once the PR is merged, publish a GitHub release for \`#{new_version}\`, targeting \`trunk\`,
7776
creating a new \`#{new_version} tag in the process.
7877
7978
The creation of the new tag will trigger a CI workflow that will take care of doing the

docs/screenshot-compositor.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This argument is a path to the directory containing the screenshots, typically g
2323

2424
**`metadata_folder`**
2525

26-
This argument is a path to the directory containing any metadata, such as localized strings for use on the final screenshots. This directory should contain subdirectories named after locales.
26+
This argument is a path to the directory containing any metadata, such as localized strings for use on the final screenshots. This directory should contain subdirectories named after locales.
2727

2828
> Note: The tool will automatically check these directories, and will be default use any locales found in both directories.
2929
@@ -43,7 +43,7 @@ The tool uses a `.json` file for configuration. By default, the tool will attemp
4343

4444
The following sample implementations provide a good example of how to create a configuration file:
4545

46-
- [WordPress Android](https://github.com/wordpress-mobile/WordPress-Android/blob/develop/fastlane/screenshots.json)
46+
- [WordPress Android](https://github.com/wordpress-mobile/WordPress-Android/blob/trunk/fastlane/screenshots.json)
4747

4848
## Creating a configuration file
4949

@@ -160,7 +160,7 @@ Entries specify the set of output screenshots. This takes the form of an array o
160160

161161
> Note: There is a 1:1 relationship between entries and the final screenshots. Note that it is not necessary to create a set of entries for each locale – this is automatically handled for you.
162162
163-
Each entry looks something like this:
163+
Each entry looks something like this:
164164

165165
```json
166166
{
@@ -251,19 +251,19 @@ Specifies a list of attachments, which can be images or text. They are composite
251251
```
252252
Text attachments use the following keys:
253253

254-
**`text`**
254+
**`text`**
255255

256256
Specifies the path to the text file for this attachment. The path should be specified relative to the configuration file, and can contain the `{locale}` placeholder to allow for localization.
257257

258-
**`size`**
258+
**`size`**
259259

260-
Sets the dimensions of the text bounding box within the final image. This must be provided as an array with two values corresponding to the width and height, respectively. If the size is too small, the compositor will crash saying it was unable to draw the text in an area this small. The text will be horizontally and vertically centered within the bounding box.
260+
Sets the dimensions of the text bounding box within the final image. This must be provided as an array with two values corresponding to the width and height, respectively. If the size is too small, the compositor will crash saying it was unable to draw the text in an area this small. The text will be horizontally and vertically centered within the bounding box.
261261

262-
**`position`**
262+
**`position`**
263263

264264
Sets the origin of the text bounding box within the final image. This must be provided as an array with two values corresponding to the x and y coordinates, respectively.
265265

266-
**`font-size`**
266+
**`font-size`**
267267

268268
Specifies the font size for the text of this attachment. If this number is too large, such that it doesn't fit into the bounding box described by the `size` key, the compositor will exit with an error message.
269269

@@ -282,19 +282,19 @@ Specifies a stylesheet used for this attachment. It should contain a path to the
282282

283283
Image attachments use the following keys:
284284

285-
**`file`**
285+
**`file`**
286286

287287
Specifies the path to the attachment image. The path should be specified relative to the configuration file, and can contain the `{locale}` placeholder to allow for localization.
288288

289-
**`size`**
289+
**`size`**
290290

291291
Sets the dimensions of the attachment within the final image. This must be provided as an array with two values corresponding to the width and height, respectively.
292292

293-
**`position`**
293+
**`position`**
294294

295295
Sets the origin of the attachment within the final image. This must be provided as an array with two values corresponding to the x and y coordinates, respectively.
296296

297-
**`operations`**
297+
**`operations`**
298298

299299
Specifies a set of operations to perform on the attachment prior to drawing it to the canvas. Operations run in the order they're specified within the configuration file. Operations are defined as an array of hashes. For example:
300300

@@ -308,18 +308,18 @@ Specifies a set of operations to perform on the attachment prior to drawing it t
308308

309309
They use the following keys:
310310

311-
**`type`**
311+
**`type`**
312312

313313
Describes the type of operation. Currently `crop` is the only operation that can be specified.
314314

315315
**Operations**
316316

317317
*Crop* allows you to crop the image using two keys:
318318

319-
**`at`**
319+
**`at`**
320320

321321
Specifies the origin point crop bounding box. This must be provided as an array with two values corresponding to the x and y coordinates, respectively.
322322

323-
**`to`**
323+
**`to`**
324324

325325
Specifies the dimensions of the crop bounding box. This must be provided as an array with two values corresponding to the width and height, respectively.

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ def self.run(params)
88
require_relative '../../helper/android/android_version_helper'
99
require_relative '../../helper/android/android_git_helper'
1010

11-
# Checkout develop and update
12-
Fastlane::Helper::GitHelper.checkout_and_pull('develop')
11+
# Checkout default branch and update
12+
default_branch = params[:default_branch]
13+
Fastlane::Helper::GitHelper.checkout_and_pull(default_branch)
1314

1415
# Check versions
1516
release_version = Fastlane::Helper::Android::VersionHelper.get_release_version
@@ -80,6 +81,11 @@ def self.available_options
8081
description: 'Skips confirmation',
8182
is_string: false, # true: verifies the input is a string, false: every kind of value
8283
default_value: false), # the default value if the user didn't provide one
84+
FastlaneCore::ConfigItem.new(key: :default_branch,
85+
env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
86+
description: 'Default branch of the repository',
87+
type: String,
88+
default_value: Fastlane::Helper::GitHelper::DEFAULT_GIT_BRANCH),
8389
]
8490
end
8591

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ def self.run(params)
88
require_relative '../../helper/android/android_version_helper'
99
require_relative '../../helper/android/android_git_helper'
1010

11-
other_action.ensure_git_branch(branch: 'develop')
11+
default_branch = params[:default_branch]
12+
other_action.ensure_git_branch(branch: default_branch)
1213

1314
# Create new configuration
1415
new_short_version = Fastlane::Helper::Android::VersionHelper.bump_version_release
@@ -28,9 +29,9 @@ def self.run(params)
2829
UI.message("New version: #{new_short_version}")
2930
UI.message("Release branch: #{new_release_branch}")
3031

31-
# Update local develop and branch
32+
# Update local default branch and create branch from it
3233
UI.message 'Creating new branch...'
33-
Fastlane::Helper::GitHelper.create_branch(new_release_branch, from: 'develop')
34+
Fastlane::Helper::GitHelper.create_branch(new_release_branch, from: default_branch)
3435
UI.message 'Done!'
3536

3637
UI.message 'Updating app version...'
@@ -52,7 +53,13 @@ def self.details
5253
end
5354

5455
def self.available_options
55-
# Define all options your action supports.
56+
[
57+
FastlaneCore::ConfigItem.new(key: :default_branch,
58+
env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
59+
description: 'Default branch of the repository',
60+
type: String,
61+
default_value: Fastlane::Helper::GitHelper::DEFAULT_GIT_BRANCH),
62+
]
5663
end
5764

5865
def self.output

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ def self.run(params)
1111
require_relative '../../helper/android/android_version_helper'
1212
require_relative '../../helper/android/android_git_helper'
1313

14-
# Checkout develop and update
15-
Fastlane::Helper::GitHelper.checkout_and_pull('develop')
14+
# Checkout default branch and update
15+
default_branch = params[:default_branch]
16+
Fastlane::Helper::GitHelper.checkout_and_pull(default_branch)
1617

1718
# Create versions
1819
current_version = Fastlane::Helper::Android::VersionHelper.get_release_version
@@ -23,7 +24,7 @@ def self.run(params)
2324
no_alpha_version_message = "No alpha version configured. If you wish to configure an alpha version please update version.properties to include an alpha key for this app\n"
2425
# Ask user confirmation
2526
unless params[:skip_confirm]
26-
confirm_message = "Building a new release branch starting from develop.\nCurrent version is #{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
27+
confirm_message = "Building a new release branch starting from #{default_branch}.\nCurrent version is #{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
2728
confirm_message += current_alpha_version.nil? ? no_alpha_version_message : "Current Alpha version is #{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{current_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
2829
confirm_message += "After codefreeze the new version will be: #{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
2930
confirm_message += current_alpha_version.nil? ? '' : "After codefreeze the new Alpha will be: #{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]} (#{next_alpha_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]}).\n"
@@ -47,7 +48,7 @@ def self.description
4748
end
4849

4950
def self.details
50-
'Updates the develop branch, checks the app version and ensure the branch is clean'
51+
'Updates the default branch, checks the app version and ensure the branch is clean'
5152
end
5253

5354
def self.available_options
@@ -58,6 +59,11 @@ def self.available_options
5859
description: 'Skips confirmation before codefreeze',
5960
is_string: false, # true: verifies the input is a string, false: every kind of value
6061
default_value: false), # the default value if the user didn't provide one
62+
FastlaneCore::ConfigItem.new(key: :default_branch,
63+
env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
64+
description: 'Default branch of the repository',
65+
type: String,
66+
default_value: Fastlane::Helper::GitHelper::DEFAULT_GIT_BRANCH),
6167
]
6268
end
6369

0 commit comments

Comments
 (0)