build: configure rust_realease publishing
This commit is contained in:
parent
3522a4abb8
commit
c262dcabd6
|
|
@ -59,7 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
||||
|
||||
[[package]]
|
||||
name = "balatro-seed-engine"
|
||||
name = "balatro-seed-search"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,16 @@
|
|||
[package]
|
||||
name = "balatro-seed-engine"
|
||||
name = "balatro-seed-search"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
autobins = false
|
||||
description = "Native Rust CLI and engine for searching Balatro seeds"
|
||||
license = "MIT"
|
||||
repository = "https://proxy.dandaedre.com/gitea/idle-org/balatro-seed-search"
|
||||
|
||||
[package.metadata.binstall]
|
||||
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.tgz"
|
||||
pkg-fmt = "tgz"
|
||||
bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"
|
||||
|
||||
[features]
|
||||
default = ["parallel"]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
[build.env]
|
||||
passthrough = ["RUSTUP_TOOLCHAIN"]
|
||||
|
||||
[target.x86_64-unknown-linux-musl]
|
||||
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main"
|
||||
|
||||
[target.aarch64-unknown-linux-musl]
|
||||
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main"
|
||||
|
||||
[target.x86_64-pc-windows-gnu]
|
||||
image = "ghcr.io/cross-rs/x86_64-pc-windows-gnu:main"
|
||||
30
README.md
30
README.md
|
|
@ -33,7 +33,16 @@ cargo build --release --locked --bin balatro-seed-search
|
|||
./target/release/balatro-seed-search --help
|
||||
```
|
||||
|
||||
Tagged releases are packaged as native command-line binaries.
|
||||
After the first tagged release, `cargo-binstall` can install its matching native
|
||||
archive directly from the canonical repository:
|
||||
|
||||
```bash
|
||||
cargo binstall --git \
|
||||
https://proxy.dandaedre.com/gitea/idle-org/balatro-seed-search \
|
||||
balatro-seed-search
|
||||
```
|
||||
|
||||
Tagged releases target x86-64 and ARM64 Linux (musl) plus x86-64 Windows (GNU).
|
||||
|
||||
## Friendly joker search
|
||||
|
||||
|
|
@ -160,3 +169,22 @@ cargo run --release --example bench_throughput
|
|||
The benchmark binary covers joker, boss, voucher, tag, pack, and mixed filters.
|
||||
`AGENT.md` and `TASK.md` record the native migration contract and acceptance
|
||||
work. See `LICENSE` for licensing.
|
||||
|
||||
## Releasing
|
||||
|
||||
This repository follows the `rust_realease` contract. Preview the complete
|
||||
release plan without building or contacting Gitea:
|
||||
|
||||
```bash
|
||||
rust_realease . --dry-run
|
||||
```
|
||||
|
||||
The package version must match an existing local and remote `vVERSION` tag for
|
||||
publication. Cross and a Docker- or Podman-compatible backend build the three
|
||||
targets declared in `rust-release.toml`; cargo-binstall is needed to package and
|
||||
verify the archives. Publish with a Gitea token supplied by `GITEA_TOKEN` or a
|
||||
token file:
|
||||
|
||||
```bash
|
||||
rust_realease . --token-file ../gitea_token.txt
|
||||
```
|
||||
|
|
|
|||
2
TASK.md
2
TASK.md
|
|
@ -157,7 +157,7 @@ Known gaps to address:
|
|||
--locked -- -D warnings`; `git diff --check`.
|
||||
- Commit: `refactor: flatten native Rust package`.
|
||||
|
||||
- [ ] **12. Adopt the rust_realease publishing contract.**
|
||||
- [x] **12. Adopt the rust_realease publishing contract.**
|
||||
- Add package repository and cargo-binstall metadata matching the release
|
||||
archive layout.
|
||||
- Add `rust-release.toml` and Cross target configuration for the supported
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
// future native optimizations will need to approach.
|
||||
|
||||
use std::time::Instant;
|
||||
use balatro_seed_engine::filter::{Clause, Filter};
|
||||
use balatro_seed_engine::search::Searcher;
|
||||
use balatro_seed_engine::state::{Deck, RunConfig, Stake};
|
||||
use balatro_seed_search::filter::{Clause, Filter};
|
||||
use balatro_seed_search::search::Searcher;
|
||||
use balatro_seed_search::state::{Deck, RunConfig, Stake};
|
||||
|
||||
fn main() {
|
||||
let filter = Filter {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
// future native optimizations will need to approach.
|
||||
|
||||
use std::time::Instant;
|
||||
use balatro_seed_engine::filter::{Clause, Filter};
|
||||
use balatro_seed_engine::search::Searcher;
|
||||
use balatro_seed_engine::state::{Deck, RunConfig, Stake};
|
||||
use balatro_seed_search::filter::{Clause, Filter};
|
||||
use balatro_seed_search::search::Searcher;
|
||||
use balatro_seed_search::state::{Deck, RunConfig, Stake};
|
||||
|
||||
fn bench(label: &str, clauses: Vec<Clause>, count: u64) {
|
||||
let filter = Filter { clauses, partial: false, min_score: None };
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use balatro_seed_engine::derive::{next_joker, next_boss, next_tag, next_voucher};
|
||||
use balatro_seed_engine::instance::{Instance, RandomSource};
|
||||
use balatro_seed_search::derive::{next_boss, next_joker, next_tag, next_voucher};
|
||||
use balatro_seed_search::instance::{Instance, RandomSource};
|
||||
|
||||
fn main() {
|
||||
for seed in ["7LB2WZYX", "PHRAYJUS", "BLUEPRINT", "AAAAAAAA"] {
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
// over 200k seeds and confirm we get a reasonable hit rate.
|
||||
|
||||
use std::time::Instant;
|
||||
use balatro_seed_engine::filter::{Clause, Filter};
|
||||
use balatro_seed_engine::search::Searcher;
|
||||
use balatro_seed_engine::state::{Deck, RunConfig, Stake};
|
||||
use balatro_seed_search::filter::{Clause, Filter};
|
||||
use balatro_seed_search::search::Searcher;
|
||||
use balatro_seed_search::state::{Deck, RunConfig, Stake};
|
||||
|
||||
fn run(label: &str, filter: Filter, count: u64, partial: bool, min_score: u8) {
|
||||
let compiled = filter.compile();
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
//! Sweeps 100k seeds for each smoke test, prints hit rates. Hit rate must be
|
||||
//! plausible (jokers should not be 0% or 100% across the sample).
|
||||
|
||||
use balatro_seed_engine::filter::{Clause, Filter};
|
||||
use balatro_seed_engine::search::Searcher;
|
||||
use balatro_seed_engine::state::{Deck, RunConfig, Stake};
|
||||
use balatro_seed_search::filter::{Clause, Filter};
|
||||
use balatro_seed_search::search::Searcher;
|
||||
use balatro_seed_search::state::{Deck, RunConfig, Stake};
|
||||
|
||||
fn sweep(name: &str, clauses: Vec<Clause>, seeds: u64) -> u64 {
|
||||
let filter = Filter { clauses, partial: false, min_score: None };
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@
|
|||
//! cargo run --release --example verify -- [N]
|
||||
//! where N is the number of seeds to sweep (default 100_000).
|
||||
|
||||
use balatro_seed_engine::derive::{
|
||||
use balatro_seed_search::derive::{
|
||||
next_boss, next_joker, next_joker_with_stickers, next_pack, next_planet,
|
||||
next_spectral, next_tarot, open_pack,
|
||||
};
|
||||
use balatro_seed_engine::instance::{Instance, RandomSource};
|
||||
use balatro_seed_engine::state::Stake;
|
||||
use balatro_seed_engine::tables::{
|
||||
use balatro_seed_search::instance::{Instance, RandomSource};
|
||||
use balatro_seed_search::state::Stake;
|
||||
use balatro_seed_search::tables::{
|
||||
BOSSES, COMMON_JOKERS, LEGENDARY_JOKERS, PLANETS, RARE_JOKERS, SPECTRALS, TAROTS, UNCOMMON_JOKERS,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
[release]
|
||||
tag-prefix = "v"
|
||||
|
||||
[build]
|
||||
targets = [
|
||||
"x86_64-unknown-linux-musl",
|
||||
"aarch64-unknown-linux-musl",
|
||||
"x86_64-pc-windows-gnu",
|
||||
]
|
||||
profile = "release"
|
||||
locked = true
|
||||
|
||||
[package]
|
||||
format = "tgz"
|
||||
|
||||
[[repository.fallbacks]]
|
||||
origin = "https://github.com/JupiterianSoul/Balatro-Seed-Searcher"
|
||||
fallback-url = "https://proxy.dandaedre.com/gitea/idle-org/balatro-seed-search"
|
||||
|
||||
[gitea]
|
||||
token-env = "GITEA_TOKEN"
|
||||
|
|
@ -6,18 +6,18 @@ use std::sync::Arc;
|
|||
use std::time::{Duration, Instant};
|
||||
|
||||
use anyhow::{bail, Context, Result};
|
||||
use balatro_seed_engine::filter::{Clause, Filter};
|
||||
use balatro_seed_engine::inspect::{inspect_filter, inspect_overview};
|
||||
use balatro_seed_engine::search::{Match, Searcher};
|
||||
use balatro_seed_engine::state::RunConfig;
|
||||
use balatro_seed_engine::tables::{
|
||||
use balatro_seed_search::filter::{Clause, Filter};
|
||||
use balatro_seed_search::inspect::{inspect_filter, inspect_overview};
|
||||
use balatro_seed_search::search::{Match, Searcher};
|
||||
use balatro_seed_search::state::RunConfig;
|
||||
use balatro_seed_search::tables::{
|
||||
BOSSES, CARDS, ENHANCEMENTS, PLANETS, SEALS, SPECTRALS, STD_EDITIONS, TAGS, TAROTS, VOUCHERS,
|
||||
};
|
||||
use balatro_seed_engine::validation::{
|
||||
use balatro_seed_search::validation::{
|
||||
all_jokers, canonical_name, max_seed_rank, parse_deck, parse_stake, ValueKind, DECKS, EDITIONS,
|
||||
STAKES, STICKERS,
|
||||
};
|
||||
use balatro_seed_engine::Seed;
|
||||
use balatro_seed_search::Seed;
|
||||
use clap::{Args, Parser, Subcommand, ValueEnum};
|
||||
use rayon::ThreadPool;
|
||||
|
||||
|
|
@ -498,7 +498,7 @@ fn read_filter(path: &PathBuf) -> Result<Filter> {
|
|||
}
|
||||
}
|
||||
|
||||
fn compile_filter(filter: &Filter) -> Result<balatro_seed_engine::filter::Compiled> {
|
||||
fn compile_filter(filter: &Filter) -> Result<balatro_seed_search::filter::Compiled> {
|
||||
filter.compile_checked().map_err(|errors| {
|
||||
anyhow::anyhow!(
|
||||
"invalid filter:\n{}",
|
||||
|
|
@ -950,7 +950,7 @@ mod tests {
|
|||
|
||||
fn test_searcher<'a>(
|
||||
config: &'a RunConfig,
|
||||
compiled: &'a balatro_seed_engine::filter::Compiled,
|
||||
compiled: &'a balatro_seed_search::filter::Compiled,
|
||||
) -> Searcher<'a> {
|
||||
Searcher {
|
||||
config,
|
||||
|
|
|
|||
Loading…
Reference in New Issue