Skip to content

Commit 455905a

Browse files
author
MatΓ©o Fernandez
committed
ci: add rust_release workflow + workflow_dispatch trigger
1 parent f645477 commit 455905a

File tree

6 files changed

+144
-3
lines changed

6 files changed

+144
-3
lines changed

β€Ž.github/workflows/rust_build_test.ymlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Rust - Build & Test
22

33
on:
4-
push:
4+
workflow_dispatch:
55
pull_request:
6+
push:
67

78
env:
89
CARGO_TERM_COLOR: always

β€Ž.github/workflows/rust_lint.ymlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Rust - Linting
22

33
on:
4-
push:
4+
workflow_dispatch:
55
pull_request:
6+
push:
67

78
env:
89
CARGO_TERM_COLOR: always
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Rust - Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- v[0-9]+.*
10+
11+
jobs:
12+
generate-changelog:
13+
name: Generate changelog
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_body: ${{ steps.git-cliff.outputs.content }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Generate changelog
23+
uses: orhun/git-cliff-action@v4
24+
id: git-cliff
25+
with:
26+
config: cliff.toml
27+
args: -vv --latest --strip header
28+
env:
29+
OUTPUT: CHANGES.md
30+
GITHUB_REPO: ${{ github.repository }}
31+
32+
create-release:
33+
needs: generate-changelog
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Create CHANGELOG file
39+
run: echo "${{ needs.generate-changelog.outputs.release_body }}" > CHANGELOG.md
40+
41+
- uses: taiki-e/create-gh-release-action@v1
42+
with:
43+
changelog: CHANGELOG.md
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
46+
upload-assets:
47+
needs: create-release
48+
strategy:
49+
matrix:
50+
include:
51+
# if you need more targets, you can open an issue
52+
- target: x86_64-unknown-linux-gnu
53+
os: ubuntu-latest
54+
runs-on: ${{ matrix.os }}
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- uses: Swatinem/rust-cache@v2
59+
60+
- uses: taiki-e/upload-rust-binary-action@v1
61+
with:
62+
bin: excel_gen
63+
target: ${{ matrix.target }}
64+
archive: $bin-$tag-$target
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
asset: avro_schema.json
File renamed without changes.

β€Žcliff.tomlβ€Ž

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
#
4+
# Lines starting with "#" are comments.
5+
# Configuration options are organized into tables and keys.
6+
# See documentation for more information on available options.
7+
8+
[changelog]
9+
# template for the changelog header
10+
header = """
11+
# Changelog\n
12+
"""
13+
# template for the changelog body
14+
# https://keats.github.io/tera/docs/#introduction
15+
body = """
16+
{% if version %}\
17+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
18+
{% else %}\
19+
## [unreleased]
20+
{% endif %}\
21+
{% for group, commits in commits | group_by(attribute="group") %}
22+
### {{ group | striptags | trim | upper_first }}
23+
{% for commit in commits %}
24+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
25+
{% if commit.breaking %}[**breaking**] {% endif %}\
26+
{{ commit.message | upper_first }}\
27+
{% endfor %}
28+
{% endfor %}\n
29+
"""
30+
# remove the leading and trailing s
31+
trim = true
32+
# postprocessors
33+
postprocessors = [
34+
{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
35+
]
36+
[git]
37+
# parse the commits based on https://www.conventionalcommits.org
38+
conventional_commits = true
39+
# filter out the commits that are not conventional
40+
filter_unconventional = true
41+
# process each line of a commit as an individual commit
42+
split_commits = false
43+
# regex for preprocessing the commit messages
44+
commit_preprocessors = [
45+
# Replace issue numbers
46+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
47+
# Check spelling of the commit with https://github.com/crate-ci/typos
48+
# If the spelling is incorrect, it will be automatically fixed.
49+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
50+
]
51+
# regex for parsing and grouping commits
52+
commit_parsers = [
53+
{ message = "^feat", group = "<!-- 0 -->πŸš€ Features" },
54+
{ message = "^fix", group = "<!-- 1 -->πŸ› Bug Fixes" },
55+
{ message = "^doc", group = "<!-- 3 -->πŸ“š Documentation" },
56+
{ message = "^perf", group = "<!-- 4 -->⚑ Performance" },
57+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
58+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
59+
{ message = "^test", group = "<!-- 6 -->πŸ§ͺ Testing" },
60+
{ message = "^chore\\(release\\): prepare for", skip = true },
61+
{ message = "^chore\\(deps.*\\)", skip = true },
62+
{ message = "^chore\\(pr\\)", skip = true },
63+
{ message = "^chore\\(pull\\)", skip = true },
64+
{ message = "^chore|^ci", group = "<!-- 7 -->βš™οΈ Miscellaneous Tasks" },
65+
{ body = ".*security", group = "<!-- 8 -->πŸ›‘οΈ Security" },
66+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
67+
]
68+
# filter out the commits that are not matched by commit parsers
69+
filter_commits = false
70+
# sort the tags topologically
71+
topo_order = false
72+
# sort the commits inside sections by oldest/newest order
73+
sort_commits = "oldest"

β€Žsrc/parser/avro.rsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::excel::WorkbookDto;
33
use std::{fs::File, io::BufReader, path::PathBuf};
44
use tracing::info;
55

6-
const SCHEMA_AVRO_JSON: &str = include_str!("../../schema.json");
6+
const SCHEMA_AVRO_JSON: &str = include_str!("../../avro_schema.json");
77

88
pub struct AvroParser {
99
schema: apache_avro::Schema,

0 commit comments

Comments
Β (0)