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
30 changes: 12 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
TAG_VERSION="${{ steps.version.outputs.version }}"
ALL_MATCH=true
for pkg in npm/shellfirm npm/cli-darwin-arm64 npm/cli-darwin-x64 npm/cli-linux-x64 npm/cli-win32-x64; do
for pkg in npm/shellfirm npm/cli-darwin-arm64 npm/cli-darwin-x64 npm/cli-linux-arm64 npm/cli-linux-x64 npm/cli-win32-x64; do
PKG_VERSION=$(node -p "require('./$pkg/package.json').version")
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "::error::$pkg version ($PKG_VERSION) does not match tag (v$TAG_VERSION). Run: ./scripts/bump-npm-version.sh $TAG_VERSION"
Expand All @@ -71,7 +71,7 @@ jobs:
strategy:
fail-fast: false
matrix:
build: [x86_64-linux, x86_64-macos, aarch64-macos, x86_64-windows] # aarch64-linux,
build: [x86_64-linux, aarch64-linux, x86_64-macos, aarch64-macos, x86_64-windows]
include:
- build: x86_64-linux
os: ubuntu-latest
Expand All @@ -80,11 +80,13 @@ jobs:
cross: false
npm_pkg: cli-linux-x64
binary: shellfirm
# - build: aarch64-linux
# os: ubuntu-20.04
# rust: stable
# target: aarch64-unknown-linux-gnu
# cross: true
- build: aarch64-linux
os: ubuntu-24.04-arm
rust: stable
target: aarch64-unknown-linux-gnu
cross: false
npm_pkg: cli-linux-arm64
binary: shellfirm
- build: x86_64-macos
os: macos-latest
rust: stable
Expand Down Expand Up @@ -125,17 +127,9 @@ jobs:
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Strip release binary (linux and macos)
if: matrix.build == 'x86_64-linux' || matrix.build == 'x86_64-macos' || matrix.build == 'aarch64-macos'
if: matrix.build == 'x86_64-linux' || matrix.build == 'aarch64-linux' || matrix.build == 'x86_64-macos' || matrix.build == 'aarch64-macos'
run: strip "target/${{ matrix.target }}/release/$BIN_NAME"

- name: Strip release binary (arm)
if: matrix.build == 'aarch64-linux'
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
rustembedded/cross:${{ matrix.target }} \
aarch64-linux-gnu-strip \
/target/${{ matrix.target }}/release/$BIN_NAME
- name: Build archive
shell: bash
run: |
Expand Down Expand Up @@ -253,15 +247,15 @@ jobs:

- name: Prepare platform packages
run: |
for pkg in cli-darwin-arm64 cli-darwin-x64 cli-linux-x64 cli-win32-x64; do
for pkg in cli-darwin-arm64 cli-darwin-x64 cli-linux-arm64 cli-linux-x64 cli-win32-x64; do
cp -r artifacts/$pkg/* npm/$pkg/
done

- name: Publish platform packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
for pkg in cli-darwin-arm64 cli-darwin-x64 cli-linux-x64 cli-win32-x64; do
for pkg in cli-darwin-arm64 cli-darwin-x64 cli-linux-arm64 cli-linux-x64 cli-win32-x64; do
npm publish ./npm/$pkg --access public
done

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ brew tap kaplanelad/tap && brew install shellfirm
cargo install shellfirm
```

For prebuilt binaries through Cargo's binstall workflow:

```bash
cargo binstall shellfirm
```

Or download the binary from the [releases page](https://github.com/kaplanelad/shellfirm/releases).

---
Expand Down
12 changes: 12 additions & 0 deletions npm/cli-linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@shellfirm/cli-linux-arm64",
"version": "0.3.10",
"description": "shellfirm binary for Linux ARM64",
"license": "MIT",
"os": [
"linux"
],
"cpu": [
"arm64"
]
}
1 change: 1 addition & 0 deletions npm/shellfirm/bin/shellfirm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const path = require("path");
const PLATFORM_MAPPING = {
"darwin-arm64": "@shellfirm/cli-darwin-arm64",
"darwin-x64": "@shellfirm/cli-darwin-x64",
"linux-arm64": "@shellfirm/cli-linux-arm64",
"linux-x64": "@shellfirm/cli-linux-x64",
"win32-x64": "@shellfirm/cli-win32-x64",
};
Expand Down
1 change: 1 addition & 0 deletions npm/shellfirm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"optionalDependencies": {
"@shellfirm/cli-darwin-arm64": "0.3.10",
"@shellfirm/cli-darwin-x64": "0.3.10",
"@shellfirm/cli-linux-arm64": "0.3.10",
"@shellfirm/cli-linux-x64": "0.3.10",
"@shellfirm/cli-win32-x64": "0.3.10"
}
Expand Down
1 change: 1 addition & 0 deletions scripts/bump-npm-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PACKAGES=(
"npm/shellfirm"
"npm/cli-darwin-arm64"
"npm/cli-darwin-x64"
"npm/cli-linux-arm64"
"npm/cli-linux-x64"
"npm/cli-win32-x64"
)
Expand Down
9 changes: 9 additions & 0 deletions shellfirm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,12 @@ all = ["cli", "llm", "mcp", "ai", "wrap", "tui"]
[[bin]]
name = "shellfirm"
required-features = ["cli"]

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target-arch }-{ os-name }{ archive-suffix }"
bin-dir = "{ name }-v{ version }-{ target-arch }-{ os-name }/{ bin }{ binary-ext }"
pkg-fmt = "txz"
disabled-strategies = ["quick-install"]

[package.metadata.binstall.overrides.'cfg(target_os = "windows")']
pkg-fmt = "zip"
Loading