chore(release): v1.0.25 #62
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-14 | |
| target: aarch64-apple-darwin | |
| args: "--target aarch64-apple-darwin" | |
| cli_bin: target/aarch64-apple-darwin/release/fft | |
| cli_asset: fft-aarch64-apple-darwin | |
| - platform: ubuntu-22.04 | |
| target: "" | |
| args: "" | |
| cli_bin: target/release/fft | |
| cli_asset: fft-x86_64-unknown-linux-gnu | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 20 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "src-tauri -> target" | |
| - name: Linux dependencies | |
| if: matrix.platform == 'ubuntu-22.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file \ | |
| libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev | |
| # Keep the bundled version in lockstep with the git tag. tauri-action stamps | |
| # bundle filenames (e.g. fftracking_<ver>_amd64.AppImage) from this config | |
| # version; if it lags the tag, the published assets no longer match the URL | |
| # the install script builds and downloads 404. | |
| - name: Sync version from tag | |
| shell: bash | |
| run: | | |
| VER="${GITHUB_REF_NAME#v}" | |
| sed -i.bak -E "s/(\"version\":[[:space:]]*\")[^\"]*\"/\1${VER}\"/" src-tauri/tauri.conf.json | |
| sed -i.bak -E "s/^version = \".*\"/version = \"${VER}\"/" src-tauri/Cargo.toml | |
| rm -f src-tauri/tauri.conf.json.bak src-tauri/Cargo.toml.bak | |
| echo "synced to $VER"; grep -m1 '"version"' src-tauri/tauri.conf.json | |
| - run: npm ci | |
| - uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| releaseName: "fftracking ${{ github.ref_name }}" | |
| releaseBody: "See CHANGELOG.md for details." | |
| releaseDraft: false | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| # Headless CLI + MCP server, attached to the same release. | |
| - name: Build fft CLI | |
| run: cargo build --release -p ffcli ${{ matrix.args }} | |
| - name: Attach fft CLI to the release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cp "${{ matrix.cli_bin }}" "${{ matrix.cli_asset }}" | |
| gh release upload "${{ github.ref_name }}" "${{ matrix.cli_asset }}" --clobber | |
| # Update the Homebrew cask in mayckol/homebrew-tap with the new dmg + sha256. | |
| # Requires a HOMEBREW_TAP_GITHUB_TOKEN secret with push access to the tap. | |
| cask: | |
| needs: build | |
| runs-on: macos-14 | |
| if: ${{ !github.event.repository.private }} | |
| steps: | |
| - name: Build & push cask | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
| run: | | |
| set -euo pipefail | |
| [ -n "${TAP_TOKEN:-}" ] || { echo "HOMEBREW_TAP_GITHUB_TOKEN not set — skipping cask update"; exit 0; } | |
| TAG="${GITHUB_REF_NAME}"; VER="${TAG#v}" | |
| gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern "*aarch64*.dmg" --dir . | |
| DMG="$(ls *aarch64*.dmg 2>/dev/null | head -1)" | |
| [ -n "$DMG" ] || { echo "No DMG found matching *aarch64*.dmg"; exit 1; } | |
| SHA="$(shasum -a 256 "$DMG" | awk '{print $1}')" | |
| cat > fftracking.rb <<EOF | |
| cask "fftracking" do | |
| version "${VER}" | |
| sha256 "${SHA}" | |
| url "https://github.com/mayckol/fftracking/releases/download/v#{version}/${DMG}" | |
| name "fftracking" | |
| desc "Local file-history & breaking-point tracker" | |
| homepage "https://github.com/mayckol/fftracking" | |
| depends_on macos: :big_sur | |
| depends_on arch: :arm64 | |
| # Pull in the headless CLI (+ MCP server) so 'brew install --cask | |
| # fftracking' also puts 'fft' on PATH, matching the install script. | |
| depends_on formula: "mayckol/tap/fft" | |
| app "fftracking.app" | |
| # Unsigned/ad-hoc build: strip the download quarantine on install so | |
| # the app opens on a double-click instead of Gatekeeper blocking it. | |
| postflight do | |
| system_command "/usr/bin/xattr", | |
| args: ["-dr", "com.apple.quarantine", "#{appdir}/fftracking.app"] | |
| end | |
| zap trash: [ | |
| "~/Library/Application Support/com.fftracking.app", | |
| ] | |
| end | |
| EOF | |
| # Publish via the GitHub Contents API. A fine-grained PAT rejects the | |
| # token-in-URL `git push` form ("password authentication not supported"), | |
| # so write the file using the token as an API bearer instead. | |
| B64="$(base64 -i fftracking.rb | tr -d '\n')" | |
| EXISTING="$(GH_TOKEN="$TAP_TOKEN" gh api repos/mayckol/homebrew-tap/contents/Casks/fftracking.rb --jq .sha 2>/dev/null || true)" | |
| ARGS=(--method PUT repos/mayckol/homebrew-tap/contents/Casks/fftracking.rb -f "message=fftracking ${VER}" -f "content=${B64}") | |
| [ -n "${EXISTING}" ] && ARGS+=(-f "sha=${EXISTING}") | |
| GH_TOKEN="$TAP_TOKEN" gh api "${ARGS[@]}" | |
| # --- fft CLI formula: `brew install mayckol/tap/fft` (and the cask | |
| # depends on it). Ships the prebuilt fft binary per platform. --- | |
| gh release download "$TAG" --repo "$GITHUB_REPOSITORY" \ | |
| --pattern "fft-aarch64-apple-darwin" --pattern "fft-x86_64-unknown-linux-gnu" --dir cli | |
| MAC_SHA="$(shasum -a 256 cli/fft-aarch64-apple-darwin | awk '{print $1}')" | |
| LNX_SHA="$(shasum -a 256 cli/fft-x86_64-unknown-linux-gnu | awk '{print $1}')" | |
| cat > fft.rb <<EOF | |
| class Fft < Formula | |
| desc "Headless CLI + MCP server for fftracking local history" | |
| homepage "https://github.com/mayckol/fftracking" | |
| version "${VER}" | |
| on_macos do | |
| url "https://github.com/mayckol/fftracking/releases/download/v#{version}/fft-aarch64-apple-darwin" | |
| sha256 "${MAC_SHA}" | |
| end | |
| on_linux do | |
| url "https://github.com/mayckol/fftracking/releases/download/v#{version}/fft-x86_64-unknown-linux-gnu" | |
| sha256 "${LNX_SHA}" | |
| end | |
| def install | |
| bin.install Dir["*"].first => "fft" | |
| end | |
| test do | |
| assert_match "fft", shell_output("#{bin}/fft --help") | |
| end | |
| end | |
| EOF | |
| FB64="$(base64 -i fft.rb | tr -d '\n')" | |
| FEXISTING="$(GH_TOKEN="$TAP_TOKEN" gh api repos/mayckol/homebrew-tap/contents/Formula/fft.rb --jq .sha 2>/dev/null || true)" | |
| FARGS=(--method PUT repos/mayckol/homebrew-tap/contents/Formula/fft.rb -f "message=fft ${VER}" -f "content=${FB64}") | |
| [ -n "${FEXISTING}" ] && FARGS+=(-f "sha=${FEXISTING}") | |
| GH_TOKEN="$TAP_TOKEN" gh api "${FARGS[@]}" |