Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
ci: generate changelog by convention commit (#112)
Browse files Browse the repository at this point in the history
Co-authored-by: Uzias Ferreira <[email protected]>
  • Loading branch information
uziasferreirazup and Uzias Ferreira authored May 7, 2020
1 parent 7ea8d67 commit a75e504
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pr_danger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Beagle PR Danger

on:
pull_request:
branches:
types: [edited, synchronize, reopened, opened]
branches:
- master
jobs:
danger-pr:
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-semantic_release (1.9.1)
gh_inspector (1.1.3)
git (1.7.0)
rchardet (~> 1.8)
Expand Down Expand Up @@ -253,6 +254,7 @@ DEPENDENCIES
danger-swiftlint
fastlane
fastlane-plugin-codecov_reporter!
fastlane-plugin-semantic_release
xcode-install

BUNDLED WITH
Expand Down
4 changes: 2 additions & 2 deletions doc/contributing/commits.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ format that includes a **type**, a **scope**, and a **subject**:
<footer>
```

The header is mandatory and the scope of the header is optional.
The header is mandatory and the scope of the footer is optional.
Each line in the commit message should be no longer than 100 characters.

When opening an PR, make sure you do at least one of the following:
Expand Down Expand Up @@ -47,7 +47,7 @@ Example:
In the example above, you might want to keep `13131da` and `34d2331` separated to help in the review process and that would be fine.

> **Note:** It would NOT be all right for `34d2331` to follow the conventions because it doesn't bring any meaningful change to `master`.
> Conventional commits should only be used to describe changes that will land in the main branch, NOT for changes to your own branch.
** Conventional commits should only be used to describe changes that will land in the main branch, NOT for changes to your own branch.**

## What types can I use for my commit messages?

Expand Down
13 changes: 6 additions & 7 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ end
desc "Generate release notes"
private_lane :release_notes do
get_previous_tag = sh "bash ./get_previous_tag.sh"
changelog = changelog_from_git_commits(
between: [get_previous_tag, ENV["VERSION_DEPLOY"]],
merge_commit_filtering: "exclude_merges",
pretty: "%s - (%ae %aD)"
)

lane_context[SharedValues::RELEASE_ANALYZED] = true
lane_context[SharedValues::RELEASE_LAST_TAG_HASH] = get_previous_tag
lane_context[SharedValues::RELEASE_NEXT_VERSION] = ENV["VERSION_DEPLOY"]
changelog = conventional_changelog(display_title: false, display_links: false)
"\nRelease notes #{ ENV["VERSION_DEPLOY"] }
\nChanges:
\n#{changelog}"
\nChanges:
\n#{changelog}"
end


Expand Down
3 changes: 2 additions & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#
# Ensure this file is checked in to source control!

gem "fastlane-plugin-codecov_reporter", git: "https://github.com/uziasferreirazup/fastlane-plugin-codecov_reporter"
gem "fastlane-plugin-codecov_reporter", git: "https://github.com/uziasferreirazup/fastlane-plugin-codecov_reporter"
gem 'fastlane-plugin-semantic_release'
3 changes: 2 additions & 1 deletion fastlane/get_previous_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ if [ $all_tags = 0 ] || [ $all_tags = 1 ]
then
printf `git rev-list --max-parents=0 HEAD`
else
printf `git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1)`
previous_tag=`git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1)`
printf `git show-ref -s $previous_tag`
fi

0 comments on commit a75e504

Please sign in to comment.