From 3d9ea563eadcc7bd970bed4d160230738174fa30 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 24 Aug 2026 07:06:25 +0000 Subject: [PATCH 1/3] Publish platform binaries to GitHub Releases from v* tags. Pushing a version tag that matches Cargo.toml now creates the GitHub Release and uploads amendable archives for Linux (musl), macOS, and Windows so users do not need a local Rust toolchain. Co-authored-by: Fang-Pen Lin --- .github/workflows/release.yml | 73 +++++++++++++++++++++++++++++++++++ AGENTS.md | 10 +++++ README.md | 31 +++++++++++++-- 3 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..61ff446 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +# Publish amendable binaries to GitHub Releases when a v* tag is pushed. +# Set Cargo.toml version, commit on master, then: git tag vX.Y.Z && git push origin vX.Y.Z +name: Release + +permissions: + contents: read + +on: + push: + tags: + - v[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/v') + 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#v}" + cargo_version="$(awk -F '"' '/^\[package\]/{p=1} p&&/^version =/{print $2; exit}' Cargo.toml)" + if [ "$tag" != "$cargo_version" ]; then + echo "Tag v${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: ${{ github.event_name == 'push' && 'write' || 'read' }} + 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' }} diff --git a/AGENTS.md b/AGENTS.md index 5bc120f..1743ab9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 `vMAJOR.MINOR.PATCH` tag (`git tag v0.1.0 && git push origin v0.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. diff --git a/README.md b/README.md index 12df4ef..82574ee 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,25 @@ 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 @@ -11,7 +28,15 @@ 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 @@ -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`): From 10315dbb71b9e391c834dc1a2cebb95cc0574d6a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 24 Aug 2026 07:23:17 +0000 Subject: [PATCH 2/3] Fix Release workflow permissions so GitHub can parse the file. Job-level contents permission must be a static read/write/none value. Co-authored-by: Fang-Pen Lin --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61ff446..cca99a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: os: windows-latest runs-on: ${{ matrix.os }} permissions: - contents: ${{ github.event_name == 'push' && 'write' || 'read' }} + contents: write steps: - uses: actions/checkout@v4 - uses: taiki-e/upload-rust-binary-action@v1 From 2ff51625afb8fe2bc3678a7a9a619c33fbdca233 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 24 Aug 2026 07:27:53 +0000 Subject: [PATCH 3/3] Use x.y.z tags for releases, without a v prefix. The workflow now triggers on tags like 0.1.0 rather than v0.1.0. Co-authored-by: Fang-Pen Lin --- .github/workflows/release.yml | 13 +++++++------ AGENTS.md | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cca99a2..67783fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ -# Publish amendable binaries to GitHub Releases when a v* tag is pushed. -# Set Cargo.toml version, commit on master, then: git tag vX.Y.Z && git push origin vX.Y.Z +# 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: @@ -8,7 +8,8 @@ permissions: on: push: tags: - - v[0-9]+.* + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-*' pull_request: paths: - .github/workflows/release.yml @@ -19,7 +20,7 @@ env: jobs: create-release: - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest permissions: contents: write @@ -28,10 +29,10 @@ jobs: - name: Check Cargo.toml version matches tag run: | set -euo pipefail - tag="${GITHUB_REF_NAME#v}" + 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 v${tag} does not match Cargo.toml version ${cargo_version}" >&2 + echo "Tag ${tag} does not match Cargo.toml version ${cargo_version}" >&2 exit 1 fi - uses: taiki-e/create-gh-release-action@v1 diff --git a/AGENTS.md b/AGENTS.md index 1743ab9..3c57070 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,7 +36,7 @@ cargo clippy --all-targets -- -D warnings ## Releases -Set `version` in `Cargo.toml`, commit on `master`, then push a matching `vMAJOR.MINOR.PATCH` tag (`git tag v0.1.0 && git push origin v0.1.0`). GitHub Actions creates the GitHub Release and uploads `amendable` archives: +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