Skip to content

Commit e775848

Browse files
authored
fix: remove NIL_DIR env var (#316)
* fix: remove `NIL_DIR` env var * chore: bump version * ci: trusted publishing
1 parent 6b85aff commit e775848

File tree

12 files changed

+48
-45
lines changed

12 files changed

+48
-45
lines changed

.cargo/config.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ rustflags = []
44

55
[env]
66
CARGO_TARGET_DIR = "target"
7-
8-
# Relative to the home dir.
9-
NIL_DIR = ".tsukilabs/nil"

.github/CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Here’s a simplified list of the steps you’ll need to take. In some cases, yo
5151
## Environment variables
5252

5353
- [`NIL_DATABASE_URL`](/crates/nil-server/src/main.rs)
54-
- [`NIL_DIR`](/app/src-tauri/src/manager.rs)
5554
- [`NIL_JWT_SECRET`](/crates/nil-server/src/middleware/authorization.rs)
5655
- [`NIL_LOG_DIR`](/crates/nil-log/src/lib.rs)
5756
- [`NIL_LOG_TOWER_HTTP`](/crates/nil-log/src/lib.rs)

.github/workflows/release.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
name: Release
22

33
on:
4-
workflow_dispatch:
54
push:
65
branches: [release]
76

87
jobs:
8+
publish:
9+
runs-on: ubuntu-24.04
10+
permissions:
11+
contents: write
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Install Rust
17+
uses: dtolnay/rust-toolchain@nightly
18+
19+
- uses: rust-lang/crates-io-auth-action@v1
20+
id: auth
21+
- run: cargo publish --workspace
22+
env:
23+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
24+
925
release-client:
26+
needs: publish
1027
permissions:
1128
contents: write
1229
strategy:
@@ -72,8 +89,7 @@ jobs:
7289
uses: dtolnay/rust-toolchain@nightly
7390

7491
- name: Install dependencies (Ubuntu)
75-
run: |
76-
sudo apt-get update
92+
run: sudo apt-get update
7793

7894
- name: Release
7995
run: cargo +nightly -Zscript scripts/build-server.rs --release

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ members = [
2121

2222
[workspace.package]
2323
description = "Multiplayer strategy game"
24-
version = "0.3.0"
24+
version = "0.3.1"
2525
edition = "2024"
2626
rust-version = "1.95"
2727
license = "AGPL-3.0-only"

app/src-tauri/src/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub trait ManagerExt: Manager<Wry> {
3030

3131
fn nil_dir(&self) -> Result<PathBuf> {
3232
let mut dir = if let Some(home) = env::home_dir() {
33-
home.join(env!("NIL_DIR"))
33+
home.join(".tsukilabs/nil")
3434
} else {
3535
self.path().app_cache_dir()?
3636
};

app/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2.0.0",
33
"productName": "Call of Nil",
4-
"version": "0.3.0",
4+
"version": "0.3.1",
55
"identifier": "tsukilabs.nil",
66
"build": {
77
"beforeDevCommand": "pnpm run -F ui dev",

crates/nil-client/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ authors.workspace = true
1414

1515
[package.metadata.docs.rs]
1616
no-default-features = true
17-
features = ["lua"]
17+
features = []
1818
default-target = "x86_64-unknown-linux-gnu"
1919
targets = []
2020

@@ -47,10 +47,8 @@ tokio-tungstenite.workspace = true
4747
url.workspace = true
4848

4949
[dependencies.mlua]
50-
version = "0.11"
50+
workspace = true
5151
optional = true
52-
default-features = false
53-
features = ["lua55"]
5452

5553
[features]
5654
lua = ["dep:mlua", "nil-core/lua"]

crates/nil-core/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ authors.workspace = true
1414

1515
[package.metadata.docs.rs]
1616
no-default-features = true
17-
features = ["lua"]
17+
features = []
1818
default-target = "x86_64-unknown-linux-gnu"
1919
targets = []
2020

@@ -51,10 +51,8 @@ tracing.workspace = true
5151
uuid.workspace = true
5252

5353
[dependencies.mlua]
54-
version = "0.11"
54+
workspace = true
5555
optional = true
56-
default-features = false
57-
features = ["lua55"]
5856

5957
[features]
6058
lua = ["dep:mlua"]

crates/nil-crypto/src/password.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::borrow::Cow;
1010
use std::fmt;
1111
use std::ops::Deref;
1212
use std::sync::Arc;
13-
use tap::Pipe;
13+
use tap::{Pipe, TapFallible};
1414

1515
#[derive(Clone, Default, From, Into, PartialEq, Eq, Hash, Deserialize, Serialize)]
1616
#[from(String, &str, Arc<str>, Box<str>, Cow<'_, str>)]
@@ -32,14 +32,9 @@ impl Password {
3232
}
3333

3434
pub fn verify(&self, hash: &str) -> bool {
35-
let result = verify(self.0.as_bytes(), hash);
36-
37-
#[cfg(debug_assertions)]
38-
if let Err(err) = &result {
39-
tracing::debug!(error = %err);
40-
}
41-
42-
result.is_ok()
35+
verify(self.0.as_bytes(), hash)
36+
.tap_err_dbg(|err| tracing::debug!(error = %err))
37+
.is_ok()
4338
}
4439
}
4540

0 commit comments

Comments
 (0)