Skip to content

Commit 3ac4f0f

Browse files
committed
Enhance GitHub Actions workflow to compute and use a detailed tag for releases
1 parent ce92533 commit 3ac4f0f

File tree

2 files changed

+28
-29
lines changed

2 files changed

+28
-29
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,13 @@ jobs:
7272
runs-on: ubuntu-latest
7373
needs: [ build ]
7474
steps:
75-
- name: Compute short SHA
75+
- name: Compute tag variables
7676
id: vars
7777
shell: bash
78-
run: echo "short_sha=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
78+
run: |
79+
short_sha=${GITHUB_SHA::7}
80+
echo "short_sha=$short_sha" >> "$GITHUB_OUTPUT"
81+
echo "tag=build-${short_sha}-${GITHUB_RUN_NUMBER}.${GITHUB_RUN_ATTEMPT}" >> "$GITHUB_OUTPUT"
7982
8083
- name: Download all artifacts
8184
uses: actions/download-artifact@v4
@@ -85,8 +88,8 @@ jobs:
8588
- name: Create GitHub Release and upload assets
8689
uses: softprops/action-gh-release@v2
8790
with:
88-
name: build-${{ steps.vars.outputs.short_sha }}
89-
tag_name: build-${{ steps.vars.outputs.short_sha }}
91+
name: ${{ steps.vars.outputs.tag }}
92+
tag_name: ${{ steps.vars.outputs.tag }}
9093
draft: false
9194
prerelease: false
9295
files: dist/**/*

README.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
11
rust_collatz_solution
22
=====================
33

4-
A high‑performance Collatz explorer with big‑integer support and a lightweight visualizer.
4+
Collatz explorer with big‑integers and a tiny live visualizer. One command to try it.
55

6-
- Arbitrary precision via `num-bigint::BigUint` (explores up to 2^2000 and beyond)
7-
- O(1) memory cycle detection (Floyd’s algorithm)
8-
- Random‑shot mode by default across [2^68, 2^2000−1]
9-
- Minimal disk writes: only writes `solution.txt` when a finding occurs
10-
- Optional 500×500 GUI (minifb) animates trajectories and shows the current seed
6+
<img width="500" height="531" alt="Visualizer" src="https://github.com/user-attachments/assets/05894ec5-fdf6-407f-ba98-85f0ee8044a4" />
117

128
Quick Start
139
-----------
1410

15-
- Run with defaults (random scanning + viz):
11+
- Easiest: run with the defaults (random + viz)
1612
- `cargo run --release --`
17-
- More frequent visualization updates:
13+
- Want more motion? draw more often
1814
- `cargo run --release -- --viz-interval 100 --viz-max-steps 3000`
19-
- Sequential (no random), starting at a value:
15+
- Sequential (no random), start from a value
2016
- `cargo run --release -- --no-random --start 100000000000000000000`
2117

22-
Note: When using `cargo run`, pass program flags after `--` so Cargo doesn’t parse them.
18+
Tip: when using `cargo run`, put program flags after `--`.
2319

24-
CLI Flags
25-
---------
20+
What it does
21+
------------
2622

27-
- `--start <DECIMAL>`: starting value (decimal string); used when `--no-random`.
28-
- `--count <N>`: stop after testing N starts (for experiments/testing).
29-
- `--solution <PATH>`: path for the single‑line solution file (default `solution.txt`).
30-
- `--random` / `--no-random` (default `--random`): random shots vs sequential scan.
31-
- `--viz` / `--no-viz` (default `--viz`): enable/disable the visualizer.
32-
- `--viz-interval <N>`: send a new seed to the GUI every N starts (default 1000).
33-
- `--viz-max-steps <N>`: sliding window width for the animated line (default 10,000).
23+
- Scans huge numbers (BigUint, up to 2^2000+)
24+
- Detects loops/runaways with O(1) memory
25+
- Writes to disk only when a finding occurs (`solution.txt`)
26+
- Visualizer shows the current line and the number being tested
3427

35-
Output
36-
------
28+
Handy flags
29+
-----------
3730

38-
- `solution.txt`: written and fsynced on first finding, then the app exits.
39-
- Formats: `NONTRIVIAL_CYCLE_START <n>` or `RUNAWAY_STEPS_OVERFLOW_START <n>`.
31+
- `--random` / `--no-random` (default: random on)
32+
- `--viz` / `--no-viz` (default: viz on)
33+
- `--viz-interval <N>`: send a new seed to the GUI every N starts (default 1000)
34+
- `--viz-max-steps <N>`: line window width (default 10_000)
35+
- `--start <DECIMAL>` and `--count <N>` for sequential runs
4036

4137
Releases
4238
--------
4339

44-
This repo includes a GitHub Actions workflow that builds and publishes archives per commit (tagged by short SHA) for:
40+
GitHub Actions builds downloadable archives per commit (named by short SHA) for:
4541

4642
- Linux x86_64 (GNU)
4743
- Windows x86_64 (MSVC)
4844
- Windows i686 (MSVC)
4945

50-
Each archive includes the compiled executable. See the Releases tab for downloads.
46+
Download from Releases and run the executable. That’s it.

0 commit comments

Comments
 (0)