Skip to content

Commit 99e407e

Browse files
authored
feat: implement enforce command (#2)
1 parent 5193c28 commit 99e407e

15 files changed

+1492
-5
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ ubuntu-latest, windows-latest, macOS-latest ]
11+
rust: [ stable ]
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Rust toolchain
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
profile: minimal
19+
toolchain: ${{ matrix.rust }}
20+
components: rustfmt, clippy
21+
override: true
22+
23+
- name: Cargo Fmt Check
24+
uses: actions-rs/cargo@v1
25+
with:
26+
command: fmt
27+
args: --all -- --check
28+
29+
- name: Cargo Clippy
30+
uses: actions-rs/cargo@v1
31+
with:
32+
command: clippy
33+
args: -- -D warnings
34+
35+
- name: Cargo Test
36+
uses: actions-rs/cargo@v1
37+
with:
38+
command: test
39+
args: --tests
40+

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Auto Release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
jobs:
10+
release:
11+
name: Auto Release by Tags
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Repository
16+
uses: actions/checkout@v4
17+
18+
- name: Install Rust toolchain
19+
run: |
20+
rustup set profile minimal
21+
rustup update --no-self-update stable
22+
rustup default stable
23+
24+
- name: Cargo Login
25+
run: cargo login ${{ secrets.CARGO_TOKEN }}
26+
27+
- name: Cargo Publish
28+
run: cargo publish
29+
30+
- name: GitHub Release
31+
id: create_release
32+
uses: actions/create-release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
35+
with:
36+
tag_name: ${{ github.ref }}
37+
release_name: Release ${{ github.ref }}
38+
draft: false
39+
prerelease: false

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
debug/
44
target/
55

6-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8-
Cargo.lock
9-
106
# These are backup files generated by rustfmt
117
**/*.rs.bk
128

0 commit comments

Comments
 (0)