Skip to content

Commit 498660d

Browse files
committed
chore(github): streamline repository configuration and ci
1 parent 7330e57 commit 498660d

File tree

8 files changed

+134
-92
lines changed

8 files changed

+134
-92
lines changed

.github/ISSUE_TEMPLATE/bug.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: 'bug: '
5+
labels: bug
6+
---
7+
## Bug Description
8+
<!-- Describe what's not working -->
9+
10+
## Steps to Reproduce
11+
12+
1.
13+
2.
14+
3.
15+
16+
## Expected vs Actual
17+
<!-- What did you expect vs what happened? -->
18+
19+
## Environment
20+
21+
- OS: <!-- e.g., Ubuntu 22.04 -->
22+
- Version: <!-- which version you're using -->

.github/ISSUE_TEMPLATE/feature.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea or enhancement
4+
title: 'feat: '
5+
labels: enhancement
6+
---
7+
## Idea
8+
<!-- Describe your idea -->
9+
10+
## Why?
11+
<!-- Why do you think this would be useful? -->
12+
13+
## Additional Details
14+
<!-- Add any other context here -->

.github/PULL_REQUEST_TEMPLATE/bugfix.md

-35
This file was deleted.

.github/PULL_REQUEST_TEMPLATE/feature.md

-45
This file was deleted.

.github/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
labels:
2+
- name: bug
3+
color: d73a4a
4+
description: Something isn't working
5+
6+
- name: enhancement
7+
color: a2eeef
8+
description: New feature or improvement

.github/pull_request_template.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Pull Request
2+
3+
**Type**
4+
5+
- [ ] Bug fix (fixes #)
6+
- [ ] New feature (closes #)
7+
- [ ] Documentation
8+
- [ ] Other
9+
10+
**Description**
11+
<!-- Describe your changes -->
12+
13+
**Testing**
14+
<!-- How have you tested these changes? -->
15+
16+
**Checklist**
17+
18+
- [ ] Tests added/updated
19+
- [ ] Runs `make check` successfully
20+
- [ ] Documentation updated
21+
- [ ] Breaking changes documented (if any)

.github/workflows/ci.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: dtolnay/rust-toolchain@stable
18+
with:
19+
components: rustfmt, clippy
20+
targets: wasm32-unknown-unknown
21+
22+
- uses: Swatinem/rust-cache@v2
23+
24+
- name: Lint
25+
run: |
26+
cargo fmt -- --check
27+
cargo clippy --all-features -- -D warnings
28+
29+
test:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: dtolnay/rust-toolchain@stable
35+
with:
36+
toolchain: stable
37+
38+
- uses: Swatinem/rust-cache@v2
39+
40+
- name: Test
41+
run: cargo test --all-features
42+
43+
build:
44+
runs-on: ubuntu-latest
45+
needs: [lint, test]
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- uses: dtolnay/rust-toolchain@stable
50+
51+
- uses: Swatinem/rust-cache@v2
52+
53+
- name: Build
54+
run: cargo build --release --all-features

.github/workflows/publish.yml

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
name: Publish Crate
2+
23
on:
34
push:
4-
branches:
5-
- main
65
tags:
76
- 'v[0-9]+.[0-9]+.[0-9]+*'
87

8+
env:
9+
CARGO_TERM_COLOR: always
10+
911
jobs:
1012
publish:
1113
runs-on: ubuntu-latest
1214
steps:
1315
- uses: actions/checkout@v4
1416

1517
- uses: dtolnay/rust-toolchain@stable
16-
with:
17-
components: rustfmt, clippy
18-
targets: wasm32-unknown-unknown
1918

2019
- uses: Swatinem/rust-cache@v2
2120

22-
- name: Lint
21+
- name: Verify tag version matches Cargo.toml
2322
run: |
24-
cargo fmt -- --check
25-
cargo clippy --all-features -- -D warnings
23+
TAG_VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
24+
CARGO_VERSION=$(cargo pkgid | sed 's/.*#//')
25+
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
26+
echo "Tag version ($TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)"
27+
exit 1
28+
fi
2629
27-
- name: Test
30+
- name: Run tests
2831
run: cargo test --all-features
2932

30-
- name: Build
31-
run: cargo build --release --all-features
33+
- name: Verify package
34+
run: cargo publish --dry-run
3235

3336
- name: Publish
3437
env:
3538
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
36-
run: cargo publish --allow-dirty
39+
run: cargo publish

0 commit comments

Comments
 (0)