Skip to content
Merged
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
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Publish amendable binaries to GitHub Releases when an x.y.z tag is pushed.
# Set Cargo.toml version, commit on master, then: git tag X.Y.Z && git push origin X.Y.Z
name: Release

permissions:
contents: read

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
pull_request:
paths:
- .github/workflows/release.yml

env:
CARGO_INCREMENTAL: "0"
CARGO_TERM_COLOR: always

jobs:
create-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Check Cargo.toml version matches tag
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
cargo_version="$(awk -F '"' '/^\[package\]/{p=1} p&&/^version =/{print $2; exit}' Cargo.toml)"
if [ "$tag" != "$cargo_version" ]; then
echo "Tag ${tag} does not match Cargo.toml version ${cargo_version}" >&2
exit 1
fi
- uses: taiki-e/create-gh-release-action@v1
with:
branch: master

upload-assets:
needs: create-release
if: ${{ !cancelled() && (needs.create-release.result == 'success' || needs.create-release.result == 'skipped') }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: amendable
target: ${{ matrix.target }}
tar: unix
zip: windows
checksum: sha256
include: LICENSE,README.md
locked: true
dry-run: ${{ github.event_name != 'push' }}
dry-run-intended: ${{ github.event_name != 'push' }}
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@ cargo test
cargo fmt --check
cargo clippy --all-targets -- -D warnings
```

## Releases

Set `version` in `Cargo.toml`, commit on `master`, then push a matching `MAJOR.MINOR.PATCH` tag (`git tag 0.1.0 && git push origin 0.1.0`). GitHub Actions creates the GitHub Release and uploads `amendable` archives:

- Linux x86_64 and ARM64 (static musl)
- macOS Apple Silicon and Intel
- Windows x86_64

The tag must point at a commit on `master` and must match `Cargo.toml`. Do not create the GitHub Release in the UI first; the workflow creates it from the tag.
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,41 @@

Command line client for [Amendable](https://amendable.io). The command name is `amendable`.

## Install

Download the archive for your OS from [GitHub Releases](https://github.com/LaunchPlatform/amendable-cli/releases/latest). Extract `amendable` and put it on `PATH`.

| Platform | Archive |
| --- | --- |
| Linux x86_64 | `amendable-x86_64-unknown-linux-musl.tar.gz` |
| Linux ARM64 | `amendable-aarch64-unknown-linux-musl.tar.gz` |
| macOS Apple Silicon | `amendable-aarch64-apple-darwin.tar.gz` |
| macOS Intel | `amendable-x86_64-apple-darwin.tar.gz` |
| Windows x86_64 | `amendable-x86_64-pc-windows-msvc.zip` |

Linux archives are static musl builds.

```bash
cargo install --git https://github.com/LaunchPlatform/amendable-cli --locked
curl -fsSL -o amendable.tar.gz \
https://github.com/LaunchPlatform/amendable-cli/releases/latest/download/amendable-x86_64-unknown-linux-musl.tar.gz
tar -xzf amendable.tar.gz amendable
sudo mv amendable /usr/local/bin/amendable
amendable login
amendable repo create hello
amendable repo clone hello
```

Talks to `https://api.amendable.io` by default.

## Install from a checkout
### Cargo

Requires Rust 1.85+ ([rustup](https://rustup.rs/)).

```bash
cargo install --git https://github.com/LaunchPlatform/amendable-cli --locked
```

From a checkout:

```bash
git clone https://github.com/LaunchPlatform/amendable-cli.git
Expand All @@ -20,8 +45,6 @@ cargo install --path . --locked
amendable --help
```

Requires Rust 1.85+ ([rustup](https://rustup.rs/)).

## Config

`~/.config/amendable/config.toml` (created on `login`, mode `0600`):
Expand Down
Loading