Skip to content

Commit 515c66a

Browse files
committed
add gh actions workflow + readme changes
1 parent f081b88 commit 515c66a

File tree

2 files changed

+93
-6
lines changed

2 files changed

+93
-6
lines changed

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*.*.*'
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Rust toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
25+
- name: Build
26+
run: cargo build --release --locked
27+
28+
- name: Prepare artifacts for Windows
29+
if: matrix.os == 'windows-latest'
30+
run: |
31+
mv target/release/ascii-rs.exe target/release/ascii-rs-windows-${{ github.ref }}.exe
32+
shell: bash
33+
34+
- name: Prepare artifacts for Linux
35+
if: matrix.os == 'ubuntu-latest'
36+
run: |
37+
mv target/release/ascii-rs target/release/ascii-rs-ubuntu-${{ github.ref }}
38+
shell: bash
39+
40+
- name: Prepare artifacts for macOS
41+
if: matrix.os == 'macos-latest'
42+
run: |
43+
mv target/release/ascii-rs target/release/ascii-rs-macos-${{ github.ref }}
44+
shell: bash
45+
46+
- name: Upload artifacts
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: ascii-rs-${{ matrix.os }}
50+
path: |
51+
target/release/ascii-rs-ubuntu-${{ github.ref }}
52+
target/release/ascii-rs-windows-${{ github.ref }}.exe
53+
target/release/ascii-rs-macos-${{ github.ref }}
54+
55+
create-release:
56+
name: Create Release
57+
runs-on: ubuntu-latest
58+
needs: release
59+
steps:
60+
- name: Download all artifacts
61+
uses: actions/download-artifact@v4
62+
with:
63+
path: artifacts
64+
65+
- name: Create Release and Upload Assets
66+
uses: softprops/action-gh-release@v2
67+
with:
68+
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') }}
69+
files: |
70+
artifacts/ascii-rs-ubuntu-${{ github.ref }}/ascii-rs-ubuntu-${{ github.ref }}
71+
artifacts/ascii-rs-windows-${{ github.ref }}.exe/ascii-rs-windows-${{ github.ref }}.exe
72+
artifacts/ascii-rs-macos-${{ github.ref }}/ascii-rs-macos-${{ github.ref }}

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,36 @@ And everyone's favourite:
1212

1313
![bad_apple.png](img/bad_apple.png)
1414

15-
## Steps to run
15+
## Pre-requisites
16+
17+
- CPU with decent performance
18+
- FFmpeg (must be on your system PATH)
19+
- A terminal emulator that supports Unicode and ANSI escape codes
20+
21+
## Usage
22+
23+
- Grab the latest release from [releases](https://github.com/minhcrafters/ascii-rs/releases) (Windows-only for now).
24+
- Extract the archive and navigate to the root directory.
25+
- Run in your terminal:
26+
```bash
27+
./ascii-rs(.exe) <path-to-video> # play the video
28+
29+
./ascii-rs(.exe) <path-to-video> --regenerate # force rebuild the ASCII cache
30+
```
31+
32+
## Manual Installation
1633

1734
- If not already, install Rust [via rustup](https://rustup.rs) and FFmpeg (ffmpeg must be on your system PATH).
18-
- Put a video file somewhere on your machine (e.g., videos/sample.mp4).
35+
- Clone this repository and navigate to the root directory.
1936
- From the project root, run in your terminal:
20-
- Debug: `cargo run -- <path-to-video>`
21-
- Release: `cargo run --release -- <path-to-video>`
22-
- Use Ctrl+C to stop playback at any time.
37+
- Debug: `cargo run -- <path-to-video> # --regenerate`
38+
- Release: `cargo run --release -- <path-to-video> # --regenerate`
2339

2440
## Notes
2541

2642
- Larger terminals look better; a minimum of `30 columns x 20 rows` is recommended.
2743
- Tested on Windows Terminal (Powershell): Achieved ~30fps with `305 columns x 109 rows` (from a 1080p/30fps video) running on a 3.6GHz CPU.
2844
- A cache file is created to speed up subsequent runs of the same video.
29-
- Add --regenerate to force rebuilding the ASCII cache for that video.
3045

3146
## Dependencies
3247

0 commit comments

Comments
 (0)