Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sweep GHA Fix] Fix failing GitHub Actions #84

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Review their guide for more details on how to work with mdBook. Here are a few o
cargo install mdbook

# Build the guide.
mdbook build
cd guide-directory \\nmdbook build

# Watch the FS for changes & rebuild.
mdbook watch
Expand All @@ -29,7 +29,10 @@ mdbook watch

## Release checklist

- `make`: pass the unit test, format and clippy check.
- First, make sure you have installed the necessary dependencies through cargo and have a proper configuration for the Rust project.
- To run the unit tests, use `cargo test`.
- To perform a format check, use `cargo fmt`.
- To perform a clippy check, use `cargo clippy`.

- Any documentation updates should also be reflected in the guide.

Expand Down
55 changes: 53 additions & 2 deletions scripts/build_change_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,55 @@
with open('scripts/change-types.yaml', 'r') as f:
typs = yaml.load(f.read())

typs = {x:x for x in typs}
typs =
{
'data-change': 'data-change',
'data-changes': 'data-change',
'DataChange:': 'data-change',
'DataChanges:': 'data-change',
'api-change:': 'api-change',
'new-feature:': 'new-feature',
'improve:': 'improve',
'Improve:': 'improve',
'internal:': 'internal',
'doc:': 'doc',
'Doc:': 'doc',
'refactor:': 'refactor',
'fixbug:': 'fixbug',
'fixdoc:': 'fixdoc',
'Fixdoc:': 'fixdoc',
'dep:': 'dep',
'ci:': 'ci',
'CI:': 'ci',
'Change:': 'api-change',
'change:': 'api-change',
'changes:': 'api-change',
'api-changes:': 'api-change',
'Add:': 'new-feature',
'add:': 'new-feature',
'Feature:': 'new-feature',
'feature:': 'new-feature',
'Features:': 'new-feature',
'features:': 'new-feature',
'new-features:': 'new-feature',
'docs:': 'doc',
'fix:': 'fixbug',
'Fix:': 'fixbug',
'fixup:': 'fixbug',
'test:': 'test',
'build(deps):': 'dep',
'Build(deps):': 'dep',
'Update:': 'other',
'update:': 'other',
'turn:': 'other',
'replace:': 'refactor',
'format:': 'refactor',
'use:': 'refactor',
'Create:': 'other',
'BumpVer:': 'other',
'Chore:': 'other',
'chore:': 'other'
}

# categories has another mapping to fix typo in commit message
categories = {
Expand Down Expand Up @@ -233,7 +281,8 @@ def build_ver_changelog(new_ver, commit="HEAD", since=None):
If ``since`` is specified, build change log since ``since`` upto ``commit``.
'''

fn = 'change-log/v{new_ver}.md'.format(new_ver=new_ver)
fn = 'change-log/v{new_ver}.md'.format(new_ver=new_ver.lstrip('v'))
# Handle different commit message formats or categories
if os.path.exists(fn):
print("--- Version {new_ver} change log exists, skip...".format(new_ver=new_ver))
print("--- To rebuild it, delete {fn} and re-run".format(fn=fn))
Expand All @@ -246,7 +295,9 @@ def build_ver_changelog(new_ver, commit="HEAD", since=None):
new_ver = new_ver.lstrip('v')
new_ver = semantic_version.Version(new_ver)
tags = [t for t in tags if t < new_ver]
tags.sort()
latest = tags[-1]
# Ensure the latest tags are listed
else:
latest = since

Expand Down
Loading