Skip to content

Commit

Permalink
Prepare 2.2.1 (#229)
Browse files Browse the repository at this point in the history
* Add changelog

* Add automatic changelog updates

* Remove unneeded comments

* Manually commit

* Update changelog

* Bump version

* Bump changelog version

* Update fastlane/Fastfile

Co-authored-by: nathan-mohemian <[email protected]>

* Revert "Update fastlane/Fastfile"

This reverts commit e683c68.

* Revert revert

Co-authored-by: nathan-mohemian <[email protected]>
  • Loading branch information
Daniel and nathan-mohemian authored Jun 24, 2020
1 parent 15af0e0 commit b5d78b8
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
All notable changes to this project will be documented in this file.

Include references to issue- or pull-request numbers.
Please track any of your changes in the *Unreleased* section so they can be moved to a respective version upon release.

## Unreleased
## [2.2.1] - 2020-06-24

Add your changes here.
- Copy additional parameters when updating JWT with keyId (#225)
- Add SPM installation to readme (#224)

## [2.2.0] - 2020-06-17

Expand Down
2 changes: 1 addition & 1 deletion JOSESwift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "JOSESwift"
s.version = "2.2.0"
s.version = "2.2.1"
s.license = "Apache License, Version 2.0"
s.summary = "JOSE framework for Swift"
s.authors = { "Daniel Egger" => "[email protected]", "Carol Capek" => "[email protected]", "Christoph Gigi Fuchs" => "[email protected]" }
Expand Down
2 changes: 1 addition & 1 deletion JOSESwift/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<string>2.2.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<string>2.2.1</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
32 changes: 30 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'fileutils'

fastlane_version "2.63.0"

skip_docs
Expand Down Expand Up @@ -57,6 +59,28 @@ lane :bump do |options|
new_version_xcode
end

desc "Get all pull requests since the last release"
lane :pr_commits do
# Only include squashed pull requests which end with something like "(#123)".
changelog_from_git_commits(pretty:"- %s")
.split("\n")
.grep(/\(#[0-9]*\)$/)
.join("\n")
end

lane :update_changelog do
ensure_git_status_clean

changelog_path = "../CHANGELOG.md"
changelog_additions = "## [#{get_version_number}] - #{Time.now.strftime("%Y-%m-%d")}\n\n#{pr_commits}"
changelog = File.read(changelog_path)
changelog = changelog.sub(/##/, "#{changelog_additions}\n\n\\0")
File.write(changelog_path, changelog)

sh("git commit -am 'Update changelog'")
ensure_git_status_clean
end

desc "Prepares a release by bumping version, formatting code, running tests, setting up a release preparation branch"
lane :prepare do |options|
# Ensure we prepare from current master
Expand All @@ -80,9 +104,10 @@ lane :prepare do |options|
# Update copyright year if needed
copyright

# Run tests
test

update_changelog

# Prompt for confimation
promt_text = "Version #{version} has been prepared for release. "\
"Please make any additional changes that should be included in the release before continuing. "\
Expand All @@ -104,9 +129,12 @@ lane :release_pr do
next
end

pr_body = "'This pull request was autogenerated by fastlane. :robot: :rocket:\n" \
"## Changes included in this release\n#{pr_commits}'"

gh_command = "gh pr create"\
" --title 'Prepare #{get_version_number(target: "JOSESwift")}'"\
" --body 'This pull request was autogenerated by fastlane. :robot: :rocket:'"
" --body #{pr_body}"

system(gh_command)
end
Expand Down

0 comments on commit b5d78b8

Please sign in to comment.