Skip to content

Commit 2165a14

Browse files
feature: init project
1 parent 78fd7bc commit 2165a14

File tree

9 files changed

+449
-1
lines changed

9 files changed

+449
-1
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v*
9+
pull_request:
10+
branches:
11+
- main
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build-rust:
18+
strategy:
19+
matrix:
20+
platform: [ubuntu-latest]
21+
runs-on: ${{ matrix.platform }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
submodules: recursive
27+
- name: Install Rust
28+
run: rustup toolchain install stable --component llvm-tools-preview
29+
- name: Install cargo-llvm-cov
30+
uses: taiki-e/install-action@cargo-llvm-cov
31+
- name: install nextest
32+
uses: taiki-e/install-action@nextest
33+
- uses: Swatinem/rust-cache@v2
34+
- name: Check code format
35+
run: cargo fmt -- --check
36+
- name: Check the package for errors
37+
run: cargo check --all
38+
- name: Lint rust sources
39+
run: cargo clippy --all-targets --all-features --tests --benches -- -D warnings
40+
- name: Execute rust tests
41+
run: cargo nextest run --all-features
42+
- name: Generate a changelog
43+
uses: orhun/git-cliff-action@v2
44+
id: git-cliff
45+
if: startsWith(github.ref, 'refs/tags/')
46+
with:
47+
config: cliff.toml
48+
args: -vv --latest --strip header
49+
env:
50+
OUTPUT: CHANGES.md
51+
- name: Release
52+
uses: softprops/action-gh-release@v1
53+
if: startsWith(github.ref, 'refs/tags/')
54+
with:
55+
body: ${{ steps.git-cliff.outputs.content }}

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@ Cargo.lock
1818
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
1919
# and can be added to the global gitignore or merged into this file. For a more nuclear
2020
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
21-
#.idea/
21+
#.idea/
22+
23+
# Added by cargo
24+
25+
/target
26+
27+
.codegpt
28+
.vscode

.pre-commit-config.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
fail_fast: false
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.3.0
5+
hooks:
6+
- id: check-byte-order-marker
7+
- id: check-case-conflict
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-yaml
11+
- id: end-of-file-fixer
12+
- id: mixed-line-ending
13+
- id: trailing-whitespace
14+
- repo: https://github.com/psf/black
15+
rev: 22.10.0
16+
hooks:
17+
- id: black
18+
- repo: local
19+
hooks:
20+
- id: cargo-fmt
21+
name: cargo fmt
22+
description: Format files with rustfmt.
23+
entry: bash -c 'cargo fmt -- --check'
24+
language: rust
25+
files: \.rs$
26+
args: []
27+
- id: cargo-deny
28+
name: cargo deny check
29+
description: Check cargo dependencies
30+
entry: bash -c 'cargo deny check -d'
31+
language: rust
32+
files: \.rs$
33+
args: []
34+
- id: typos
35+
name: typos
36+
description: check typo
37+
entry: bash -c 'typos'
38+
language: rust
39+
files: \.*$
40+
pass_filenames: false
41+
- id: cargo-check
42+
name: cargo check
43+
description: Check the package for errors.
44+
entry: bash -c 'cargo check --all'
45+
language: rust
46+
files: \.rs$
47+
pass_filenames: false
48+
- id: cargo-clippy
49+
name: cargo clippy
50+
description: Lint rust sources
51+
entry: bash -c 'cargo clippy --all-targets --all-features --tests --benches -- -D warnings'
52+
language: rust
53+
files: \.rs$
54+
pass_filenames: false
55+
- id: cargo-test
56+
name: cargo test
57+
description: unit test for the project
58+
entry: bash -c 'cargo nextest run --all-features'
59+
language: rust
60+
files: \.rs$
61+
pass_filenames: false

Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "RustWeb3Wallet"
3+
version = "0.1.0"
4+
edition = "2021"
5+
authors = ["Paxon Qiao <[email protected]>"]
6+
license = "MIT"
7+
8+
[dependencies]
9+
bip39 = "2.1.0"

_typos.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[default.extend-words]
2+
3+
[files]
4+
extend-exclude = ["CHANGELOG.md", "development_notes.md"]

cliff.toml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# changelog header
6+
header = """
7+
# Changelog\n
8+
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.\n
9+
"""
10+
# template for the changelog body
11+
# https://keats.github.io/tera/docs/#introduction
12+
body = """
13+
---
14+
{% if version %}\
15+
{% if previous.version %}\
16+
## [{{ version | trim_start_matches(pat="v") }}]($REPO/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
17+
{% else %}\
18+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
19+
{% endif %}\
20+
{% else %}\
21+
## [unreleased]
22+
{% endif %}\
23+
{% for group, commits in commits | group_by(attribute="group") %}
24+
### {{ group | striptags | trim | upper_first }}
25+
{% for commit in commits
26+
| filter(attribute="scope")
27+
| sort(attribute="scope") %}
28+
- **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \
29+
{{ commit.message|trim }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})) - {{ commit.author.name }}
30+
{%- endfor -%}
31+
{% raw %}\n{% endraw %}\
32+
{%- for commit in commits %}
33+
{%- if commit.scope -%}
34+
{% else -%}
35+
- {% if commit.breaking %} [**breaking**]{% endif %}\
36+
{{ commit.message|trim }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})) - {{ commit.author.name }}
37+
{% endif -%}
38+
{% endfor -%}
39+
{% endfor %}\n
40+
"""
41+
# template for the changelog footer
42+
footer = """
43+
<!-- generated by git-cliff -->
44+
"""
45+
# remove the leading and trailing whitespace from the templates
46+
trim = true
47+
# postprocessors
48+
postprocessors = [
49+
{ pattern = '\$REPO', replace = "https://github.com/qiaopengjun5162/RustWeb3Wallet" }, # replace repository URL
50+
]
51+
52+
[git]
53+
# parse the commits based on https://www.conventionalcommits.org
54+
conventional_commits = true
55+
# filter out the commits that are not conventional
56+
filter_unconventional = false
57+
# process each line of a commit as an individual commit
58+
split_commits = false
59+
# regex for preprocessing the commit messages
60+
commit_preprocessors = [
61+
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
62+
]
63+
# regex for parsing and grouping commits
64+
commit_parsers = [
65+
{ message = "\\[skip", skip = true },
66+
{ message = "\\p{Han}", skip = true },
67+
{ message = "^feat", group = "Features" },
68+
{ message = "^fix", group = "Bug Fixes" },
69+
{ message = "^doc", group = "Documentation" },
70+
{ message = "^perf", group = "Performance" },
71+
{ message = "^refactor", group = "Refactoring" },
72+
{ message = "^style", group = "Style" },
73+
{ message = "^revert", group = "Revert" },
74+
{ message = "^test", group = "Tests" },
75+
{ message = "^chore\\(version\\):", skip = true },
76+
{ message = "^chore", group = "Miscellaneous Chores" },
77+
{ message = ".*", group = "Other" },
78+
{ body = ".*security", group = "Security" },
79+
]
80+
# protect breaking changes from being skipped due to matching a skipping commit_parser
81+
protect_breaking_commits = false
82+
# filter out the commits that are not matched by commit parsers
83+
filter_commits = false
84+
# regex for matching git tags
85+
tag_pattern = "v[0-9].*"
86+
# regex for skipping tags
87+
skip_tags = "v0.1.0-beta.1"
88+
# regex for ignoring tags
89+
ignore_tags = ""
90+
# sort the tags topologically
91+
topo_order = false
92+
# sort the commits inside sections by oldest/newest order
93+
sort_commits = "oldest"
94+
# limit the number of commits included in the changelog.
95+
# limit_commits = 42

0 commit comments

Comments
 (0)