Skip to content

Commit 8ad8930

Browse files
jqueguinerclaude
andauthored
ci: build + publish Rust CLI binaries for all platforms on release (#8)
Add .github/workflows/rust-release.yml: on a v* tag (or manual dispatch), cross-build the faker2 CLI for Linux x86_64/aarch64 (gnu + musl), macOS Intel/Apple-Silicon and Windows, then attach the archives + sha256 checksums to the GitHub Release. Uses default features (self-contained, no dataset). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 45f4979 commit 8ad8930

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/rust-release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Rust release binaries
2+
3+
# Build the `faker2` Rust CLI for every platform and attach the archives to the
4+
# GitHub Release. Triggers on a version tag (e.g. `v0.1.0`) or manually.
5+
#
6+
# The released binary uses the crate's default features (zero-dependency core +
7+
# bundled-locale providers); it does NOT bundle the parquet dataset, so it stays
8+
# small and self-contained. For the data-backed `real-names` feature, build from
9+
# source with `--features real-names`.
10+
11+
on:
12+
push:
13+
tags:
14+
- "v*"
15+
workflow_dispatch:
16+
inputs:
17+
tag:
18+
description: "Tag/release to upload assets to (e.g. v0.1.0)"
19+
required: true
20+
21+
permissions:
22+
contents: write
23+
24+
jobs:
25+
build:
26+
name: ${{ matrix.target }}
27+
runs-on: ${{ matrix.os }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
- target: x86_64-unknown-linux-gnu
33+
os: ubuntu-latest
34+
- target: aarch64-unknown-linux-gnu
35+
os: ubuntu-latest
36+
- target: x86_64-unknown-linux-musl
37+
os: ubuntu-latest
38+
- target: aarch64-apple-darwin
39+
os: macos-latest
40+
- target: x86_64-apple-darwin
41+
os: macos-13
42+
- target: x86_64-pc-windows-msvc
43+
os: windows-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Publish binary
48+
uses: taiki-e/upload-rust-binary-action@v1
49+
with:
50+
bin: faker2
51+
target: ${{ matrix.target }}
52+
manifest-path: rust/Cargo.toml
53+
archive: faker2-$tag-$target
54+
# tar.gz for unix, zip for windows (default handling)
55+
checksum: sha256
56+
ref: refs/tags/${{ github.event.inputs.tag || github.ref_name }}
57+
token: ${{ secrets.GITHUB_TOKEN }}

rust/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ grammar::agree(3, "dog"); // "3 dogs"
116116
grammar::is_are(2); // "are"
117117
```
118118

119+
## Install
120+
121+
Prebuilt `faker2` CLI binaries for Linux (x86_64/aarch64, gnu + musl), macOS
122+
(Intel + Apple Silicon) and Windows are attached to each
123+
[GitHub Release](https://github.com/jqueguiner/faker2/releases) — download the
124+
archive for your platform and extract the binary. Releases are built by
125+
`.github/workflows/rust-release.yml` on every `v*` tag.
126+
127+
Or build from source (below).
128+
119129
## Build & test
120130

121131
```

0 commit comments

Comments
 (0)