diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08ac612..55808ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ Thanks for your interest in qqqa. This doc is for contributors and for anyone cu ## Building Releases -We keep prebuilt binaries in `target/releases/` inside the repo and retain ~3 latest versions; this directory is already gitignored, so the tarballs stay local and never bloat the repo. The `scripts/release.sh` helper automates the heavy lifting, prints next steps, and updates the Homebrew tap for you. +We keep prebuilt binaries in `target/releases/` inside the repo and retain ~3 latest versions; this directory is already gitignored, so the tarballs stay local and never bloat the repo. The `scripts/release.sh` helper automates the heavy lifting and prints next steps. Prerequisites - Clean working tree and passing tests. @@ -26,11 +26,11 @@ Prerequisites Quick start (tagging HEAD) ``` -# build artifacts, update Cargo.toml + manifest + Homebrew tap +# build artifacts, update Cargo.toml + manifest scripts/release.sh v0.9.1 # follow the printed checklist (summary below) -git add Cargo.toml homebrew-tap/Formula/qqqa.rb +git add Cargo.toml git commit -m "release: v0.9.1" git tag -a v0.9.1 -m "qqqa v0.9.1" git push && git push --tags @@ -39,9 +39,6 @@ git push && git push --tags gh release create v0.9.1 target/releases/v0.9.1/qqqa-v0.9.1-*.tar.gz \ target/releases/v0.9.1/qqqa-v0.9.1-src.tar.gz target/releases/v0.9.1/manifest.json \\ --title "qqqa v0.9.1" --notes-file docs/RELEASE_NOTES_TEMPLATE.md - -# push the tap repo after reviewing Formula/qqqa.rb -(cd homebrew-tap && git add Formula/qqqa.rb && git commit -m "qqqa v0.9.1" && git push) ``` Tag a specific SHA by passing it as the second argument: `scripts/release.sh v0.9.1 ` (the script still prints the same checklist, but the tag command includes your SHA). @@ -56,8 +53,7 @@ What the script does - Builds `qq` and `qa` for macOS (x86_64/arm64), Linux MUSL (x86_64/arm64), and Windows (x86_64 GNU + arm64 gnullvm) by default; override `TARGETS` if needed. - Packages `qqqa-v-.tar.gz` under `target/releases/v/` with README and LICENSE. - Writes `target/releases/v/manifest.json` for upload to GitHub Releases. -- Downloads the GitHub tag archive (`https://github.com/iagooar/qqqa/archive/refs/tags/v.tar.gz`), computes its SHA256, and rewrites `homebrew-tap/Formula/qqqa.rb` with the new URL/sha/version so the tap is always aligned. -- Prints a human checklist covering commits, Git tags, `gh release create`, and pushing the Homebrew tap (artifacts stay under `target/releases/`, which is already gitignored; upload them when drafting the GitHub release). +- Prints a human checklist covering commits, Git tags, and `gh release create` (artifacts stay under `target/releases/`, which is already gitignored; upload them when drafting the GitHub release). - Provides `docs/RELEASE_NOTES_TEMPLATE.md` as a quick-start for the release description (`gh release create --notes-file docs/RELEASE_NOTES_TEMPLATE.md`). Notes diff --git a/README.md b/README.md index 9f53c0e..6d257f6 100644 --- a/README.md +++ b/README.md @@ -114,12 +114,9 @@ Minimal config snippet: ## Install -### macOS - -Use the Homebrew tap: +### Homebrew (macOS/Linux) ```sh -brew tap iagooar/qqqa brew install qqqa ``` diff --git a/scripts/release.sh b/scripts/release.sh index a995faf..59078a0 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -301,7 +301,7 @@ fi # Pack source tarball for Homebrew / manual uploads src_stage=$(mktemp -d) src_dir="qqqa-${ver}" -rsync -a --exclude='.git' --exclude='target' --exclude='homebrew-tap' --exclude='.DS_Store' ./ "${src_stage}/${src_dir}/" +rsync -a --exclude='.git' --exclude='target' --exclude='.DS_Store' ./ "${src_stage}/${src_dir}/" src_tarball="${artifact_root}/qqqa-v${ver}-src.tar.gz" tar -C "$src_stage" -czf "$src_tarball" "$src_dir" rm -rf "$src_stage" @@ -348,109 +348,19 @@ echo "==> Writing manifest ${manifest_file}" echo "}" } > "$manifest_file" -echo "==> Phase 1 complete. Artifacts staged under ${artifact_root}/" -echo " Upload the following files to your GitHub release/tag before continuing:" +echo "==> Done. Artifacts staged under ${artifact_root}/" +echo " Upload the following files to your GitHub release/tag:" for f in "${artifact_root}"/qqqa-v${ver}-*.tar.gz "$manifest_file"; do [[ -e "$f" ]] || continue echo " - $f" done echo " Attach them when running: gh release create v${ver} ..." echo - -skip_phase_two=0 -if [[ "${SKIP_PHASE2:-}" == "1" ]]; then - skip_phase_two=1 -elif [[ "${AUTO_CONTINUE:-}" == "1" ]]; then - echo "==> AUTO_CONTINUE=1 detected; proceeding to Phase 2 without waiting." -else - if [[ -t 0 ]]; then - read -r -p $'Press enter once the artifacts are uploaded and the tag archive is live (type "skip" to stop after Phase 1): ' phase_resp || true - if [[ "$phase_resp" =~ ^[Ss][Kk][Ii][Pp]$ ]]; then - skip_phase_two=1 - fi - else - echo "==> Non-interactive shell detected. Set AUTO_CONTINUE=1 to run both phases or SKIP_PHASE2=1 to finish early." - skip_phase_two=1 - fi -fi - -if [[ "$skip_phase_two" == "1" ]]; then - echo "==> Phase 2 (Homebrew tap update) skipped. Re-run this script with AUTO_CONTINUE=1 after publishing the GitHub release if needed." - exit 0 -fi - -# Homebrew tap handling now relies on the GitHub tag archive (always available once the tag exists) -tap_formula="homebrew-tap/Formula/qqqa.rb" -tap_url="https://github.com/iagooar/qqqa/archive/refs/tags/v${ver}.tar.gz" -tap_checksum_cmd="" -if command -v shasum >/dev/null 2>&1; then - tap_checksum_cmd="shasum -a 256" -elif command -v sha256sum >/dev/null 2>&1; then - tap_checksum_cmd="sha256sum" -fi -if [[ -f "$tap_formula" ]]; then - if ! command -v curl >/dev/null 2>&1; then - echo "==> WARN: curl not found; skipping Homebrew formula update." >&2 - elif [[ -z "$tap_checksum_cmd" ]]; then - echo "==> WARN: no shasum/sha256sum available; skipping Homebrew formula update." >&2 - else - tap_update_done=0 - tap_attempt=1 - while [[ $tap_update_done -eq 0 ]]; do - tap_tmp=$(mktemp) - echo "==> Downloading ${tap_url} to compute Homebrew checksum (attempt ${tap_attempt})" - if curl -fsSL "$tap_url" -o "$tap_tmp"; then - tap_sha=$($tap_checksum_cmd "$tap_tmp" | awk '{print $1}') - rm -f "$tap_tmp" - python3 < Updated Homebrew formula at $tap_formula" - echo " Remember to commit and push the tap repository (homebrew-tap)." - tap_update_done=1 - else - rm -f "$tap_tmp" - echo "==> WARN: failed to download ${tap_url}; GitHub may still be processing the release." >&2 - if [[ -t 0 ]]; then - read -r -p $'Press enter to retry once the archive is available, or type "skip" to bypass the tap update: ' retry_resp || true - if [[ "$retry_resp" =~ ^[Ss][Kk][Ii][Pp]$ ]]; then - echo "==> Skipping Homebrew formula update by request." - break - fi - else - echo "==> WARN: non-interactive shell; skipping Homebrew formula update." >&2 - break - fi - fi - tap_attempt=$((tap_attempt + 1)) - done - fi -else - echo "==> Skipping Homebrew formula update (homebrew-tap/Formula/qqqa.rb not found)." -fi - -echo "==> Done. Artifacts remain under ${artifact_root}/" echo "==> Next steps" cat <