Skip to content

Commit adb09bb

Browse files
committed
Fixed some stuff to make it more professional looking
1 parent 047613d commit adb09bb

File tree

5 files changed

+191
-149
lines changed

5 files changed

+191
-149
lines changed

.github/workflows/main.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,62 @@ jobs:
137137
dnp3time-windows-x86_64.exe/dnp3time-windows-x86_64.exe.sha256
138138
dnp3time-linux-x86_64/dnp3time-linux-x86_64
139139
dnp3time-linux-x86_64/dnp3time-linux-x86_64.sha256
140+
141+
crates_io_publish:
142+
name: Publish (crates.io)
143+
needs:
144+
- create-release
145+
146+
runs-on: ubuntu-latest
147+
timeout-minutes: 25
148+
steps:
149+
- uses: actions/checkout@v4
150+
- uses: dtolnay/rust-toolchain@stable
151+
152+
- name: cargo-release cache restore
153+
id: cargo_release_cache_restore
154+
uses: actions/cache/restore@v4
155+
with:
156+
path: ~/.cargo/bin/cargo-release
157+
key: ${{ runner.os }}-cargo-release
158+
159+
- run: cargo install cargo-release
160+
if: steps.cargo_release_cache_restore.outputs.cache-hit != 'true'
161+
162+
- name: cargo-release cache save
163+
id: cargo_release_cache_save
164+
uses: actions/cache/save@v4
165+
if: always() && steps.cargo_release_cache_restore.outputs.cache-hit != 'true'
166+
with:
167+
path: ~/.cargo/bin/cargo-release
168+
key: ${{ runner.os }}-cargo-release
169+
170+
- name: cargo login
171+
run: |-
172+
echo "${{ secrets.CRATES_IO_API_TOKEN }}" | cargo login
173+
174+
# allow-branch HEAD is because GitHub actions switches
175+
# to the tag while building, which is a detached head
176+
177+
# Publishing is currently messy, because:
178+
#
179+
# * `peace_rt_model_core` exports `NativeError` or `WebError` depending on the target.
180+
# * `peace_rt_model_web` fails to build when publishing the workspace for a native target.
181+
# * `peace_rt_model_web` still needs its dependencies to be published before it can be
182+
# published.
183+
# * `peace_rt_model_hack` needs `peace_rt_model_web` to be published before it can be
184+
# published.
185+
#
186+
# We *could* pass through `--no-verify` so `cargo` doesn't build the crate before publishing,
187+
# which is reasonable, since this job only runs after the Linux, Windows, and WASM builds
188+
# have passed.
189+
- name: "cargo release publish"
190+
run: |-
191+
cargo release \
192+
publish \
193+
--workspace \
194+
--all-features \
195+
--allow-branch HEAD \
196+
--no-confirm \
197+
--no-verify \
198+
--execute

CONTRIBUTING.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Contributing to `dnp3time`
2+
3+
We welcome contributions to the `dnp3time` project! Whether it's bug fixes, features, documentation improvements, or other enhancements, your help is appreciated.
4+
5+
## Getting Started
6+
7+
1. **Fork the Repository**
8+
To start, fork the repository and clone it locally:
9+
```bash
10+
git clone https://github.com/<your-username>/DNP3TimmingAttack.git
11+
cd DNP3TimmingAttack
12+
```
13+
14+
2. **Set Up Your Development Environment**
15+
You need to have the Rust toolchain installed. If it's not already installed, you can do so with:
16+
```bash
17+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
18+
rustup update
19+
```
20+
21+
3. **Run Tests**
22+
Confirm the project is working correctly by building and running the provided tests:
23+
```bash
24+
cargo test
25+
```
26+
27+
4. **Make Changes**
28+
Edit the code, tests, or documentation to improve the project. Be sure to follow best practices and make your changes as clean and modular as possible.
29+
30+
5. **Submit a Pull Request**
31+
After completing and testing your changes:
32+
- Push your branch to your fork.
33+
- Create a pull request in the [main repository](https://github.com/ladderlogix/DNP3TimmingAttack).
34+
35+
## Code Style
36+
`dnp3time` follows the Rust 2024 edition and the Rust style guide. Use `cargo fmt` to ensure your code is properly formatted:
37+
```bash
38+
cargo fmt
39+
```
40+
41+
To ensure your code is free of common errors, also run:
42+
```bash
43+
cargo clippy
44+
```
45+
46+
## Reporting Issues
47+
If you find a bug, file an issue on the [GitHub Issues page](https://github.com/ladderlogix/DNP3TimmingAttack/issues). Please include:
48+
- Steps to reproduce the issue.
49+
- Expected vs actual behavior.
50+
- Relevant output logs (if applicable).
51+
- Your environment (OS, Rust version, etc.).
52+
53+
## Testing Contributions
54+
If you add a feature or fix a bug, include tests to verify your changes. Write unit tests wherever applicable and ensure the entire test suite passes:
55+
```bash
56+
cargo test
57+
```
58+
59+
## Feature Requests
60+
We welcome ideas for improvements! If you have a feature in mind, file a feature request in the [GitHub Issues page](https://github.com/ladderlogix/DNP3TimmingAttack/issues).
61+
62+
---
63+
64+
Thank you for your interest in contributing!

Cargo.lock

Lines changed: 12 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
[package]
22
name = "dnp3time"
3-
version = "0.1.0"
4-
edition = "2021"
3+
version = "1.1.0"
4+
edition = "2024"
5+
description = """
6+
Allows you to set the system time using DNP3 time synchronization.
7+
"""
8+
authors = ["Stephen Glombicki <[email protected]>"]
9+
readme = "README.md"
10+
repository = "https://github.com/ladderlogix/DNP3TimmingAttack.git"
11+
license = "AGPL-3.0-only"
12+
keywords = ["dnp3"]
513

614
[dependencies]
715
tokio = { version = "1.0", features = ["full"] }
816
dnp3 = "1.6.0"
917
anyhow = "1.0.98"
10-
windows = { version = "0.48.0", features = [
11-
"Win32_Foundation",
12-
"Win32_System_SystemInformation"
13-
] }
1418
chrono = { version = "0.4", features = ["clock"] }
1519
clap = { version = "4.5.40", features = ["derive"] }

0 commit comments

Comments
 (0)