pajapro / fastlane-plugin-changelog Goto Github PK
View Code? Open in Web Editor NEWAutomate changes to your project CHANGELOG.md
License: MIT License
Automate changes to your project CHANGELOG.md
License: MIT License
a.k.a. eat your own food :)
Hello,
do you support standard changelog format?
https://github.com/conventional-changelog/conventional-changelog
Thank you!
Best regards,
Andrej
See fastlane/fastlane#13229 .
Not clear if it's an issue with Fastlane or changelog but I have not changed fastlane or changelog practices or my code for those locally and this just started breaking all of a sudden. Any ideas?
Thanks! :-)
While installing fastlane-plugin-changelog
it should check whether CHANGELOG.md
is present in project folder. If not, generate one with predefined structure.
'Keep a CHANGELOG' example uses the following pattern for titles : "## [0.3.0] - 2015-12-03", but the plugin does not paste build date after the bracket. I think it should do it by default. Alternative maybe there is an option for stamp_changelog method missed.
read_changelog
leaves white space after excluded markdown elements. In CHANGELOG format there is white space following markdown elements (e.g. headers and lists). Remove this white space, as it results in e.g.: _Added:
instead of Added
output
update_changelog currently updates only the section identifier. Action should be able to update the section content as well.
Everytime I run the following command it duplicates the last line.
stamp_changelog(
changelog_path: changelog_location, # Specify path to CHANGELOG.md
section_identifier: currentVersion,
git_tag: currentVersion, # Specify reference to git tag associated with this section
should_stamp_date: true, # Specify whether the current date as per the stamp_datetime_format should be stamped to the section identifier (default is `true`)
stamp_datetime_format: '%F', # Specify strftime format string to use for the date in the stamped section (default `%FZ`)
placeholder_line: new_unreleased_changelog
)
```
I get the error Unable to delete windows workspace due to busy git pack file after I build and use the Git changelog plugin.
seems this was reported before as well against jenkins.
https://issues.jenkins-ci.org/browse/JENKINS-19994
GitLab uses the same format as GitHub: https://gitlab.com/{author}/{project}/-/compare/{oldTag}...{newTag}
GitLab (and BitBucket, I believe) can also be slef-hosted so the domain in the URL can vary.
I suggest adding a param to indicate BitBucket (with a fallback check for the bitbucket domain) and assume GitHub format is the default.
The last line should be validated that it matches the format in order to not add junk at the end, I ended up with:
[1.1.0]: https://gitlab.com/{author}/{project}/-/compare/v1.0.0..v1.1.0.v1.0.0
I get the above error with running the stamp_changelog
action in a lane:
desc "Test Change Log maintenance"
lane :changelog do
increment_build_number
changelog = read_changelog
badge
# `gym` would be normally here
clean_build_artifacts
reset_git_repo(force: true, files: [
'appname/Assets.xcassets/AppIcon.appiconset/',
])
stamp_changelog(section_identifier: "#{get_version_number} (#{get_build_number})")
commit_version_bump
end
Indeed stamp_changelog.rb:39
contains an empty?
test.
Stack:
Hi:
My changelog is sorted with the last changes on top. Would it be possible to select the last section without the need of specifying its identifier?
Thanks
I setup the changelog plugin of the gem danger which enforces a certain changelog style which is very suitable. But it forces me to keep the line * Your contribution here.
directly under the ## [Unreleased]
section of my changelog. This is very good so contributer know where to add new changes. On the other hand I
stamp_changelog
## [Unreleased]
section when I call stamp_changelog
I propose to add the option to Exclude a certain text when stamping a changelog version and preserve this exact text in the unreleased section.
When using stamp_changelog
with a Git tag, the tag does not seem to be appended correctly.
Stamping the following change log with stamp_changelog(section_identifier: "1.0 (27)", git_tag: "example")
results in the change log in the bottom of this post.
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
- Testing
## [1.0 (26)] - 2016-10-31
- Adds build for feature/demo branch. Testing fastlane setup.
## [1.0 (25)] - 2016-10-31
- Tests distribution using fastlane.
## [1.0 (24)] - 2016-10-30
- Tests distribution of builds with fastlane.
## [1.0 (21)] - 2016-10-30
- Attempts automating build process.
Below is the result of stamping the above change log with a section identifier of "1.0 (27)" and a Git tag of "example".
# Change Log
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
## [1.0 (27)] - 2016-10-31
- Testing
## [1.0 (26)] - 2016-10-31
- Adds build for feature/demo branch. Testing fastlane setup.
## [1.0 (25)] - 2016-10-31
- Tests distribution using fastlane.
## [1.0 (24)] - 2016-10-30
- Tests distribution of builds with fastlane.
## [1.0 (21)] - 2016-10-30
- Attempts automating build process.
1.0 (27)example- Attempts automating build process.
section_identifier
should be optional. When omitted, the plugin should get the changelogs from the latest.
I have my CHANGELOG.md file outside the project to share across iOS and Android.
When stamping it, it asks me to create the file in the default location because it can't find it:
fastlane run stamp_changelog(changelog_path: '../../CHANGELOG.md', ....)
As a workaround I've created a dummy file in that place, but it would be good to not have to.
Is there a way to get the Changelog.md file from another git repo?
Hi,
Not sure if that would interest you, but our workflow requires us to sometimes combine changelog that have a section prefix in common.
For example:
<version>-<build number>
version
We already have a custom action that does this, but felt like it would belong more with your plugin. If that interests you, I can make a pull request with our code?
Thanks!
Hello,
I am getting the following error on fastlane:
Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane_core/lib/fastlane_core/ui/interface.rb:150:in `user_error!': [!] Plugin 'changelog' was not properly loaded, make sure to follow the plugin docs for troubleshooting: https://github.com/fastlane/fastlane/blob/master/fastlane/docs/PluginsTroubleshooting.md (FastlaneCore::Interface::FastlaneError)
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane_core/lib/fastlane_core/ui/ui.rb:14:in `method_missing'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/runner.rb:161:in `rescue in trigger_action_by_name'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/runner.rb:155:in `trigger_action_by_name'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/fast_file.rb:146:in `method_missing'
from Fastfile:29:in `block (2 levels) in parsing_binding'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/lane.rb:33:in `call'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/runner.rb:45:in `chdir'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/runner.rb:45:in `execute'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/lane_manager.rb:52:in `cruise_lane'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/command_line_handler.rb:30:in `handle'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/commands_generator.rb:104:in `block (2 levels) in run'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:178:in `call'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/commander-fastlane-4.4.4/lib/commander/command.rb:153:in `run'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/commander-fastlane-4.4.4/lib/commander/runner.rb:476:in `run_active_command'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:40:in `run!'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/commander-fastlane-4.4.4/lib/commander/delegates.rb:15:in `run!'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/commands_generator.rb:303:in `run'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/commands_generator.rb:42:in `start'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/fastlane/lib/fastlane/cli_tools_distributor.rb:66:in `take_off'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/gems/fastlane-2.28.8/bin/fastlane:20:in `<top (required)>'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/bin/fastlane:22:in `load'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/bin/fastlane:22:in `<main>'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/hernangonzalez/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
I am using latest release. Any ideas what could be the root? I am not getting much info from the logs :/
Thank you,
H.
Reading the very first changelog version seems to erroneously include the markdown links at the bottom of the file.
In the README example given, the excluded_markdown_elements shows double quotes within the brackets which causes the plugin to fail. If a list of elements is given, remove the single quotes on the outside of the brackets and use single quotes and commas to support the markdown elements to exclude.
BAD:
read_changelog(
changelog_path: './custom_folder/CHANGELOG.md', # Specify path to CHANGELOG.md
section_identifier: '[Unreleased]', # Specify what section to read
excluded_markdown_elements: '["###"]' # Specify which markdown elements should be excluded
)
GOOD:
read_changelog(
changelog_path: './custom_folder/CHANGELOG.md', # Specify path to CHANGELOG.md
section_identifier: '[Unreleased]', # Specify what section to read
excluded_markdown_elements: ['###'] # Specify which markdown elements should be excluded
)
Hi,
Is there any support for having localizable changelog? is there any other way than keeping multiple md files and iterating through them in custom lanes for read and stamp actions?
Thank you
The documentation invoked via: fastlane action stamp_changelog
gives that the default for stamp_date
is true
a boolean. When running the action though it seems the action is expecting a String. Furthermore when building and passing any string "false"
or "12.16.2020"
for stamp_date
the action always chooses to include the action's pre-formatted date.
Hi and thanks for your Fastlane plugin. But I encountered some issue using it.
My command is:
stamp_changelog(
section_identifier: '1.7.4',
git_tag: '1.7.4'
)
Before execution:
## [Unreleased]
### Added
- Use Fastlane
## [1.7.3] - 2016-11-04
### Changed
- Set background as white
## [1.7.2] - 2016-11-04
### Fixed
- Fix chart layout
### Changed
- Update dependencies
[Unreleased]: https://github.com/GlobalSport/mycoach-player-android/compare/1.7.3...HEAD
After execution:
## [Unreleased]
## [1.7.4] - 2016-11-09
### Added
- Use Fastlane
## [1.7.3] - 2016-11-04
### Changed
- Set background as white
## [1.7.2] - 2016-11-04
### Fixed
- Fix chart layout
### Changed
- Update dependencies
[Unreleased]: https://github.com/GlobalSport/mycoach-player-android/compare/1.7.3...HEAD
[1.7.4]: https://github.com/GlobalSport/mycoach-player-android/compare/HEAD...1.7.4
When installing the plugin in a Fastlane.swift
project no return values are provided.
public func emojifyChangelog() {
let args: [RubyCommand.Argument] = []
let command = RubyCommand(commandID: "", methodName: "emojify_changelog", className: nil, args: args)
_ = runner.executeCommand(command)
}
public func readChangelog(changelogPath: String = "./CHANGELOG.md",
sectionIdentifier: String = "[Unreleased]",
excludedMarkdownElements: [String] = ["###"]) {
let changelogPathArg = RubyCommand.Argument(name: "changelog_path", value: changelogPath, type: nil)
let sectionIdentifierArg = RubyCommand.Argument(name: "section_identifier", value: sectionIdentifier, type: nil)
let excludedMarkdownElementsArg = RubyCommand.Argument(name: "excluded_markdown_elements", value: excludedMarkdownElements, type: nil)
let array: [RubyCommand.Argument?] = [changelogPathArg,
sectionIdentifierArg,
excludedMarkdownElementsArg]
let args: [RubyCommand.Argument] = array
.filter { $0?.value != nil }
.compactMap { $0 }
let command = RubyCommand(commandID: "", methodName: "read_changelog", className: nil, args: args)
_ = runner.executeCommand(command)
}
hi, i practice these plugin and write fastfile that
lane :release_testflight do
changelog = read_changelog
stamp_changelog(
section_identifier: "#{get_version_number}", # Specify identifier to stamp the Unreleased section with
git_tag: "Ver #{build_number}", # Specify reference to git tag associated with this section
stamp_datetime_format: '%FT%TZ' # Specify strftime format string to use for the date in the stamped section (default `%FZ`)
)
end
like these. but when i run fastlane, i think there are some missunderstanding.
Added:
Changed:
Fixed:
Removed:
these template is not show in changeLog.md.
Should I write this in line with the template that I personally illustrated here on changelog.md?
what is real mean of read_changelog??
What's the difference between just handwriting on the git readme and this plugin?
Hi,
the iOS workflow looks quite straight forward to me but unf. O don't really get how I can integrate this into my android fastlane deployment to set up automated changelog texts per build
Thanks,
Toni
Hi
Using your plugin with LF in CHANGELOG.md as line separator is ok, but using CR or CRLF give incorrect result.
Source CHANGELOG.md:
## [Unreleased]
### Added
- Use Fastlane
## [1.7.3] - 2016-11-04
### Changed
- Set background as white
## [1.7.2] - 2016-11-04
### Fixed
- Fix chart layout
### Changed
- Update dependencies
Command:
stamp_changelog(
section_identifier: '1.7.4'
)
Using LF => OK:
## [Unreleased]
## [1.7.4] - 2016-11-09
### Added
- Use Fastlane
## [1.7.3] - 2016-11-04
### Changed
- Set background as white
## [1.7.2] - 2016-11-04
### Fixed
- Fix chart layout
### Changed
- Update dependencies
Using CRLF => KO:
## [Unreleased]
## [1.7.4]
- 2016-11-09
### Added
- Use Fastlane
## [1.7.3] - 2016-11-04
### Changed
- Set background as white
## [1.7.2] - 2016-11-04
### Fixed
- Fix chart layout
### Changed
- Update dependencies
Using CR => KO:
## [Unreleased]
## [1.7.4]
## [1.7.4] - 2016-11-09
### Added
- Use Fastlane
## [1.7.3] - 2016-11-04
### Changed
- Set background as white
## [1.7.2] - 2016-11-04
### Fixed
- Fix chart layout
### Changed
- Update dependencies
- 2016-11-09
Hi,
There is a way to changelog don't ask to create a changelog.md file?? I know that it will search for an existing file, but mine is in another directory.
Thank you.
For my changelogs I'm looking to include the time along with the date in the form of 2020-12-08T21:51Z
. Can support for passing a string for dates be added?
So for example:
"stamp_date": "2020-12-08T21:51Z", <- takes false, true or a string..
How can I generate the latest Unreleased Change Log?
here is Fastfile:
lane :getVersion do
version_number = get_version_number(target: "XAGApp")
build_number = get_build_number(xcodeproj: "XAGApp.xcodeproj")
version_number + "(" + build_number + ")"
end
lane :test do
version = getVersion
stamp_changelog(section_identifier: "Build #{version}")
end
here the change log after 'fastlane test'
can you help me ?
or Can this tool automatically generate change log files?
mannually write log in CHANGELOG.md file?
When you run the stamp_changelog action the last line of the [Unreleased] section gets duplicated into the newly stamped section.
Before
## [Unreleased]
### Added
- Some cool stuff
- Awesome stuff
- Amazing stuff!
After stamp_changelog(section_identifier: 1.0.0)
## [Unreleased]
## [1.0.0] - 2020-01-31
### Added
- Some cool stuff
- Awesome stuff
- Amazing stuff!
- Amazing stuff!
Due to the way update_changelog params are setup there is no way to disable the date append feature.
I have tried using false
, nil
, the ENV variable,etc.
Fail scenario:
update_changelog append_date: false)
Thanks for the plugin. It will help to create nice changelogs for us.
Our versioning flow is a bit different though. We use release branches that first increment the package.json (and add a tag) and then call fastlane.
And since a fastlane deploy could fail for a number of reasons it would be bad to have a stamped changelog before the deploy succeeded.
Do you have any recommendation to handle such flow? One solution I could think of would be a git amend at the end of a successful deploy, which adds the stamped changelog or revert the last commit that tagged the version.
Output:
INFO [2018-10-19 14:37:05.70]: ----------------------------------------
INFO [2018-10-19 14:37:05.70]: --- Step: Verifying fastlane version ---
INFO [2018-10-19 14:37:05.70]: ----------------------------------------
INFO [2018-10-19 14:37:05.70]: Your fastlane version 2.107.0 matches the minimum requirement of 1.110.0 β
INFO [2018-10-19 14:37:05.70]: ------------------------------
INFO [2018-10-19 14:37:05.70]: --- Step: default_platform ---
INFO [2018-10-19 14:37:05.70]: ------------------------------
INFO [2018-10-19 14:37:05.70]: Driving the lane 'ios add_tag' π
INFO [2018-10-19 14:37:05.70]: --------------------------------
INFO [2018-10-19 14:37:05.70]: --- Step: get_version_number ---
INFO [2018-10-19 14:37:05.70]: --------------------------------
INFO [2018-10-19 14:37:05.84]: -----------------------------
INFO [2018-10-19 14:37:05.84]: --- Step: stamp_changelog ---
INFO [2018-10-19 14:37:05.84]: -----------------------------
INFO [2018-10-19 14:37:05.84]: Starting to read [Unreleased] section from './CHANGELOG.md'
INFO [2018-10-19 14:37:05.84]: Finished reading [Unreleased] section from './CHANGELOG.md'
INFO [2018-10-19 14:37:05.84]: Starting to update [Unreleased] section of './CHANGELOG.md'
INFO [2018-10-19 14:37:05.84]: Old section identifier: ## [Unreleased]
INFO [2018-10-19 14:37:05.84]: New section identifier: ## [3.11.0] - 2018-10-19
INFO [2018-10-19 14:37:05.85]: Successfuly updated ./CHANGELOG.md
INFO [2018-10-19 14:37:05.85]: Created [Unreleased] placeholder section
INFO [2018-10-19 14:37:05.85]: Created a link for comparison between 3.10.5 and 3.11.0 tag
INFO [2018-10-19 14:37:05.85]: Successfuly stamped 3.11.0 in ./CHANGELOG.md
INFO [2018-10-19 14:37:05.85]: ------------------------
INFO [2018-10-19 14:37:05.85]: --- Step: git_commit ---
INFO [2018-10-19 14:37:05.85]: ------------------------
INFO [2018-10-19 14:37:05.85]: $ git commit -m Stamp\ 3.11.0\ in\ CHANGELOG.md ./CHANGELOG.md
INFO [2018-10-19 14:37:05.91]: βΈ [component 0453ce39] Stamp 3.11.0 in CHANGELOG.md
INFO [2018-10-19 14:37:05.91]: βΈ 1 file changed, 3 insertions(+)
INFO [2018-10-19 14:37:05.91]: Successfully committed "["./CHANGELOG.md"]" πΎ.
INFO [2018-10-19 14:37:05.92]: -------------------------
INFO [2018-10-19 14:37:05.92]: --- Step: add_git_tag ---
INFO [2018-10-19 14:37:05.92]: -------------------------
INFO [2018-10-19 14:37:05.92]: Adding git tag '3.11.0' π―.
INFO [2018-10-19 14:37:05.92]: $ git tag -am 3.11.0\ \(fastlane\) 3.11.0
console tell me old tag and new tag is right(old: 3.10.5, new: 3.11.0), but I got a wrong link:
https://github.com/bearyinnovative/Mandrake/compare/3.11.0...3.10.5.
The tags is inverted.
I saw the codes here, previous_tag and git_tag is right number.I'm confused why the result link is wrong.
Currently someone who uses increment_build_number
together with commit_version_bump
has a little rough time when using stamp_changelog
. E.g. consider the following code:
increment_build_number
stamp_changelog(section_identifier: "#{get_version_number} (#{get_build_number})")
commit_version_bump
commit_version_bump
will complain that:
[!] Found unexpected uncommited changes in the working directory. Expected these files to have
changed:
appname.xcodeproj/project.pbxproj
appname/Info.plist
appnameTests/Info.plist
appnameUITests/Info.plist.
But found these actual changes:
CHANGELOG.md
appname.xcodeproj/project.pbxproj
appname/Info.plist
appnameTests/Info.plist
appnameUITests/Info.plist.
Make sure you have cleaned up the build artifacts and
are only left with the changed version files at this stage in your lane, and don't touch the
working directory while your lane is running. You can also use the :force option to bypass this
check, and always commit a version bump regardless of the state of the working directory.
If we git_add(path: 'CHANGELOG.md')
before committing version bump, the same error will happen.
If we add force: true
parameter to the commit_verison_bump
on its own, it avoids the error, but leaves the changes to CHANGELOG.md caused by stamping as uncommitted changes.
Only combination of both is a working workaround:
increment_build_number
stamp_changelog(section_identifier: "#{get_version_number} (#{get_build_number})")
git_add(path: 'CHANGELOG.md')
commit_version_bump(force: true)
I think a better solution would be to change fastlane
itself to introduce e.g. a VERSION_BUMP_PATHS
lane context value. Actions like fastlane's own increment_build_number
and increment_version_number
, or this plugin's stamp_changelog
, could then register files with changes related to bumping version. The commit_version_bump
action would then use this shared lane context value, instead of its hardcoded list of files, to determine which files need committing for the version bump.
I will file an issue with fastlane proposing this enhancement which fastlane-plugin-changelog
could then take advantage of.
Bitbucket uses different compare URL then GitHub, URL example: https://bitbucket.org/controlsfx/controlsfx/branches/compare/8.40.9..8.20.7
Add support for Bitbucket (http://stackoverflow.com/a/31795923/975813).
Now stamp_changelog generate new section even [Unreleased] section content is empty. Maybe there is one missing option that will skip command execution in that case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.