Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/build-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,52 @@ jobs:
name: fb-darwin-${{ matrix.artifact_arch }}
path: artifacts/fb-darwin-${{ matrix.artifact_arch }}
retention-days: 7

build-windows:
strategy:
matrix:
include:
- rust_target: x86_64-pc-windows-msvc
artifact_arch: amd64
name: Build Windows binary for ${{ matrix.artifact_arch }}
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
show-progress: 'false'
fetch-depth: 0

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.rust_target }}

- name: Cache cargo registry
uses: actions/cache@v3
with:
path: |
~\.cargo\registry
~\.cargo\git
target
key: ${{ runner.os }}-${{ matrix.rust_target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.rust_target }}-cargo-

- name: Build release binary
run: cargo build --release --target ${{ matrix.rust_target }} --locked

- name: Move binary into artifacts directory
shell: pwsh
run: |
New-Item -ItemType Directory -Path artifacts -Force | Out-Null
Copy-Item "target\${{ matrix.rust_target }}\release\fb.exe" "artifacts\fb-windows-${{ matrix.artifact_arch }}.exe"

- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: fb-windows-${{ matrix.artifact_arch }}.exe
path: artifacts/fb-windows-${{ matrix.artifact_arch }}.exe
retention-days: 7
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ jobs:
with:
name: fb-darwin-arm64

- name: Download Windows amd64 binary
if: steps.compare_versions.outputs.needs_release
uses: actions/download-artifact@v4
with:
name: fb-windows-amd64.exe

- name: Generate release notes
if: steps.compare_versions.outputs.needs_release
id: release_notes
Expand Down Expand Up @@ -141,3 +147,14 @@ jobs:
asset_path: fb-darwin-arm64
asset_name: fb-darwin-arm64
asset_content_type: application/octet-stream

- name: Upload Windows amd64 binary onto release
if: steps.compare_versions.outputs.needs_release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: fb-windows-amd64.exe
asset_name: fb-windows-amd64.exe
asset_content_type: application/octet-stream
84 changes: 83 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ urlencoding = "2.1"
pest = "2.7"
pest_derive = "2.7"
console = "0.15"
keyring = { version = "3.6.3", features = ["apple-native", "linux-native"] }
keyring = { version = "3.6.3", features = ["apple-native", "linux-native", "windows-native"] }
rand = "0.8"
sha2 = "0.10"
base64 = "0.22"
Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,35 @@ The easiest way to install `fb` is to download a release binary from [**GitHub R
| `fb-linux-static-arm64` | Linux arm64 |
| `fb-darwin-amd64` | macOS Intel (amd64) |
| `fb-darwin-arm64` | macOS Apple Silicon (arm64) |
| `fb-windows-amd64.exe` | Windows amd64 (Intel/AMD 64-bit) |

2. Make it executable and install it as `fb` on your `PATH` (use the exact filename you downloaded):
2. Install it on your `PATH`:

```sh
chmod +x ./fb-linux-static-amd64
sudo mv ./fb-linux-static-amd64 /usr/local/bin/fb
```
- Linux/macOS: make it executable and install it as `fb` (use the exact filename you downloaded):

Or install to your user directory (no `sudo`):
```sh
chmod +x ./fb-linux-static-amd64
sudo mv ./fb-linux-static-amd64 /usr/local/bin/fb
```

```sh
mkdir -p ~/.local/bin
chmod +x ./fb-linux-static-amd64
mv ./fb-linux-static-amd64 ~/.local/bin/fb
```
Or install to your user directory (no `sudo`):

```sh
mkdir -p ~/.local/bin
chmod +x ./fb-linux-static-amd64
mv ./fb-linux-static-amd64 ~/.local/bin/fb
```

Ensure `~/.local/bin` is on your `PATH` (e.g. in `~/.bashrc` or `~/.zshrc`).

- Windows (PowerShell): place `fb-windows-amd64.exe` somewhere on your `PATH` and optionally rename it to `fb.exe`:

```powershell
New-Item -ItemType Directory -Force "$env:USERPROFILE\bin" | Out-Null
Move-Item .\fb-windows-amd64.exe "$env:USERPROFILE\bin\fb.exe"
```

Ensure `~/.local/bin` is on your `PATH` (e.g. in `~/.bashrc` or `~/.zshrc`).
Ensure `%USERPROFILE%\bin` is included in your user `Path` environment variable.

3. Run `fb --version` to confirm.

Expand Down
Loading