Skip to content

Commit e424614

Browse files
authored
Merge pull request #124 from clog-tool/gh-actions
Migrate to GH Actions
2 parents 99119b9 + f190944 commit e424614

File tree

10 files changed

+209
-188
lines changed

10 files changed

+209
-188
lines changed

.github/workflows/ci-pr.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ci-pr-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
test-full:
12+
name: Full
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macOS-latest]
17+
rust: [stable]
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: Install rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
profile: minimal
24+
toolchain: ${{ matrix.rust }}
25+
override: true
26+
- name: Cache Builds
27+
uses: Swatinem/rust-cache@v2
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- name: Compile
31+
run: cargo test --no-run --all-features
32+
- name: Test
33+
run: cargo test --all-features
34+
test-minimal:
35+
name: Min
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os: [ubuntu-latest, windows-latest, macOS-latest]
40+
rust: [stable]
41+
runs-on: ${{ matrix.os }}
42+
steps:
43+
- name: Install rust
44+
uses: actions-rs/toolchain@v1
45+
with:
46+
profile: minimal
47+
toolchain: ${{ matrix.rust }}
48+
override: true
49+
- name: Cache Builds
50+
uses: Swatinem/rust-cache@v2
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
- name: Compile
54+
run: cargo test --no-run --no-default-features
55+
- name: Test
56+
run: cargo test --no-default-features

.github/workflows/lint.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
lint:
8+
name: Lint
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Check spelling
14+
uses: crate-ci/typos@master
15+
with:
16+
config: ./.typos.toml
17+
18+
- name: Install Rust
19+
uses: dtolnay/rust-toolchain@stable
20+
with:
21+
toolchain: nightly
22+
components: rustfmt, clippy
23+
24+
- uses: Swatinem/rust-cache@v2
25+
26+
- name: Clippy
27+
run: cargo clippy --all-features --all-targets
28+
29+
- name: Format Check
30+
run: cargo fmt --check
31+
msrv:
32+
name: MSRV
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Install Rust
38+
uses: dtolnay/rust-toolchain@stable
39+
with:
40+
toolchain: 1.74.1 # msrv
41+
42+
- name: Check
43+
run: cargo check

.github/workflows/release_nightly.yml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
on:
3+
push:
4+
branches: [master, main]
5+
6+
name: Nightly Release
7+
8+
env:
9+
RELEASE_BIN: clog
10+
RELEASE_ADDS: >-
11+
LICENSE-APACHE
12+
LICENSE-MIT
13+
nightly-CHANGELOG.md
14+
README.md
15+
16+
jobs:
17+
nightly-release:
18+
name: Nightly Release
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions-rs/toolchain@v1
25+
with:
26+
profile: minimal
27+
toolchain: nightly
28+
override: true
29+
target: x86_64-unknown-linux-musl
30+
31+
- name: Compile
32+
uses: actions-rs/cargo@v1
33+
with:
34+
command: build
35+
args: --release --target x86_64-unknown-linux-musl
36+
37+
- name: Install CLOG
38+
uses: actions-rs/cargo@v1
39+
with:
40+
command: install
41+
args: clog-cli
42+
43+
- name: Generate Changelog
44+
run: clog -F -o nightly-CHANGELOG.md -i /dev/null
45+
46+
- name: Make artifacts dir
47+
run: mkdir -p artifacts/
48+
49+
- name: Copy all artifacts into dir
50+
run: cp target/x86_64-unknown-linux-musl/release/${{ env.RELEASE_BIN }} ${{ env.RELEASE_ADDS }} artifacts/
51+
52+
- uses: benjlevesque/[email protected]
53+
id: short-sha
54+
55+
- name: Create archive for Linux
56+
run: cd artifacts/ && tar czf ../${{ env.RELEASE_BIN }}-${{ env.SHA }}-x86_64-linux-musl.tar.gz ./*
57+
env:
58+
SHA: ${{ steps.short-sha.outputs.sha }}
59+
60+
- name: Remove previous Nightly Release
61+
uses: dev-drprasad/[email protected]
62+
with:
63+
delete_release: true
64+
tag_name: nightly
65+
repo: clog-tool/clog-cli
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Create Nightly Release
70+
uses: softprops/action-gh-release@v1
71+
with:
72+
name: clog Nightly (${{ env.SHA }})
73+
tag_name: nightly
74+
prerelease: true
75+
body_path: nightly-CHANGELOG.md
76+
files: |
77+
${{ env.RELEASE_BIN }}-${{ env.SHA }}-x86_64-linux-musl.tar.gz
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
GITHUB_REPOSITORY: clog-tool/clog-cli
81+
SHA: ${{ steps.short-sha.outputs.sha }}
82+

.github/workflows/security_audit.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
on:
3+
push:
4+
paths:
5+
- '**/Cargo.toml'
6+
- '**/Cargo.lock'
7+
8+
name: Security audit
9+
10+
jobs:
11+
security_audit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions-rs/audit-check@v1
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

-122
This file was deleted.

.typos.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[type.md.extend-words]
2+
ba = "ba"
3+
afe = "afe"

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ license = "MIT"
66
name = "clog-cli"
77
edition = "2021"
88
version = "0.9.3"
9+
rust-version = "1.74.1" # msrv
910
authors = ["Christoph Burgdorf <[email protected]>"]
1011
description = "A conventional changelog for the rest of us"
1112
exclude = ["docs/*"]

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ There are two ways to use `clog`, as a binary via the command line or as a libra
2323

2424
### Binary (Command Line)
2525

26-
In order to use `clog` via the command line you must first obtain a binary by either compiling it yourself, or downlading and installing one of the precompiled binaries.
26+
In order to use `clog` via the command line you must first obtain a binary by either compiling it yourself, or downloading and installing one of the precompiled binaries.
2727

2828
#### `cargo install`
2929

@@ -87,7 +87,7 @@ Otherwise, ensure you have the `clog` binary in the directory which you operatin
8787

8888
#### Using clog from the Command Line
8989

90-
`clog` works by reading your `git` metadata and specially crafted commit messages and subjects to create a changelog. `clog` has the following options availble.
90+
`clog` works by reading your `git` metadata and specially crafted commit messages and subjects to create a changelog. `clog` has the following options available.
9191

9292
```sh
9393
USAGE:
@@ -104,7 +104,7 @@ FLAGS:
104104
OPTIONS:
105105
-C, --changelog <changelog> A previous changelog to prepend new changes to (this is like
106106
using the same file for both --infile and --outfile and
107-
should not be used in conjuction with either)
107+
should not be used in conjunction with either)
108108
-c, --config <config> The Clog Configuration TOML file to use (Defaults to
109109
'.clog.toml')**
110110
-T, --format <format> The output format, defaults to markdown
@@ -175,7 +175,7 @@ subtitle = "my awesome title"
175175
link-style = "github"
176176
177177
# The preferred way to set a constant changelog. This file will be read for old changelog
178-
# data, then prepended to for new changelog data. It's the equivilant to setting
178+
# data, then prepended to for new changelog data. It's the equivalent to setting
179179
# both infile and outfile to the same file.
180180
#
181181
# Do not use with outfile or infile fields!
@@ -223,7 +223,7 @@ MySection = ["mysec", "ms"]
223223
224224
Now if you make a commit message such as `mysec(Component): some message` or `ms(Component): some message` there will be a new "MySection" section along side the "Features" and "Bug Fixes" areas.
225225
226-
*NOTE:* Sections with spaces are suppported, such as `"My Special Section" = ["ms", "mysec"]`
226+
*NOTE:* Sections with spaces are supported, such as `"My Special Section" = ["ms", "mysec"]`
227227
228228
## Companion Projects
229229

0 commit comments

Comments
 (0)