diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ea77ed..7420b61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,6 +44,12 @@ jobs: toolchain: ${{ env.RUST_TOOLCHAIN }} targets: ${{ matrix.target }} + - name: Ensure target std is installed + shell: bash + run: | + rustup target add ${{ matrix.target }} --toolchain ${{ env.RUST_TOOLCHAIN }} + rustup target list --installed + - name: Show toolchain info run: | rustc -vV diff --git a/Cargo.toml b/Cargo.toml index 8d92899..3fbee6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "tarts" # shortcut from Terminal Arts -version = "0.1.22" +version = "0.1.23" edition = "2024" authors = ["oiwn "] description = "Screen savers and visual effects for terminal" license = "MIT" -repository = "https://github.com/oiwn/tui-screen-savers-rs" +repository = "https://github.com/oiwn/tarts" documentation = "https://docs.rs/tarts" -homepage = "https://github.com/oiwn/tui-screen-savers-rs" +homepage = "https://github.com/oiwn/tarts" [dependencies] crossterm = "0.29" diff --git a/homebrew-formula-template.rb b/homebrew-formula-template.rb index 7f0e297..efb9931 100644 --- a/homebrew-formula-template.rb +++ b/homebrew-formula-template.rb @@ -1,26 +1,35 @@ -# Homebrew Formula Template for Tarts -# This template should be placed in a tap repository at: homebrew-taps/Formula/tarts.rb +#!/usr/bin/env ruby +# Homebrew Formula Template for Tarts (build-from-source) +# Place this file in your tap repository at: oiwn/homebrew-tarts/Formula/tarts.rb +# Then users can: `brew tap oiwn/tarts` and `brew install tarts`. class Tarts < Formula desc "Terminal Arts - Screen savers and visual effects for terminal" - homepage "https://github.com/oiwn/tui-screen-savers-rs" + homepage "https://github.com/oiwn/tarts" license "MIT" - on_macos do - if Hardware::CPU.arm? - url "https://github.com/oiwn/tui-screen-savers-rs/releases/download/v0.1.18/tarts-v0.1.18-aarch64-apple-darwin.tar.gz" - sha256 "" # TODO: Replace with actual SHA256 after release - else - url "https://github.com/oiwn/tui-screen-savers-rs/releases/download/v0.1.18/tarts-v0.1.18-x86_64-apple-darwin.tar.gz" - sha256 "" # TODO: Replace with actual SHA256 after release - end - end + # Replace VERSION and SHA256 for each tagged release + url "https://github.com/oiwn/tarts/archive/refs/tags/vVERSION.tar.gz" + sha256 "REPLACE_WITH_SHA256" + version "VERSION" + + depends_on "rust" => :build def install - bin.install "tarts" + # Build and install from source; uses the lockfile and pins deps + system "cargo", "install", "--locked", "--root", prefix.to_s, "--path", "." end test do - system "#{bin}/tarts", "--version" + assert_match version.to_s, shell_output("#{bin}/tarts --version") end -end \ No newline at end of file +end + +# How to update for a new release: +# 1) Set VERSION to the new tag (e.g., 0.1.22) +# 2) Fetch source tarball and compute SHA256: +# curl -L -o tarts-v$VERSION.tar.gz \ +# https://github.com/oiwn/tarts/archive/refs/tags/v$VERSION.tar.gz +# shasum -a 256 tarts-v$VERSION.tar.gz +# 3) Replace REPLACE_WITH_SHA256 with the hash. +# 4) Commit this formula to your tap repo (oiwn/homebrew-tarts) and push.