Skip to content

chore(workflow): update Homebrew Cask formula for Textream versioning #26

chore(workflow): update Homebrew Cask formula for Textream versioning

chore(workflow): update Homebrew Cask formula for Textream versioning #26

Workflow file for this run

name: Build & Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
version:
runs-on: macos-15
outputs:
tag: ${{ steps.version.outputs.tag }}
number: ${{ steps.version.outputs.number }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get version from tag
id: version
run: |
TAG="${GITHUB_REF#refs/tags/}"
VERSION="${TAG#v}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "number=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Update app version in Xcode project
run: |
sed -i '' "s/MARKETING_VERSION = .*;/MARKETING_VERSION = ${{ steps.version.outputs.number }};/g" Textream/Textream.xcodeproj/project.pbxproj
- name: Commit version bump
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Textream/Textream.xcodeproj/project.pbxproj
git commit -m "Bump version to ${{ steps.version.outputs.number }}" || echo "No changes to commit"
git push origin HEAD:refs/heads/main || echo "Push skipped"
build:
needs: version
strategy:
fail-fast: false
matrix:
include:
- runner: macos-15
xcode: /Applications/Xcode_16.2.app/Contents/Developer
suffix: "-macos15"
- runner: macos-26
xcode: /Applications/Xcode_26.0.app/Contents/Developer
suffix: ""
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Update app version
run: |
sed -i '' "s/MARKETING_VERSION = .*;/MARKETING_VERSION = ${{ needs.version.outputs.number }};/g" Textream/Textream.xcodeproj/project.pbxproj
- name: Select Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}
- name: Build universal app
working-directory: Textream
run: |
chmod +x build.sh
./build.sh
- name: Rename DMG
if: matrix.suffix != ''
run: mv Textream/build/release/Textream.dmg Textream/build/release/Textream${{ matrix.suffix }}.dmg
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: dmg${{ matrix.suffix }}
path: Textream/build/release/Textream${{ matrix.suffix }}.dmg
release:
needs: [version, build]
runs-on: macos-15
steps:
- name: Download all DMGs
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Upload DMGs to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/Textream.dmg
artifacts/Textream-macos15.dmg
name: Textream ${{ needs.version.outputs.tag }}
draft: false
prerelease: false
generate_release_notes: true
body: |
## Installation
- **Textream.dmg** — for macOS 26 Tahoe and later (recommended, includes Liquid Glass effects)
- **Textream-macos15.dmg** — for macOS 15 Sequoia
1. Download the DMG for your macOS version
2. Open the DMG and drag **Textream** to Applications
3. Since the app is not notarized, macOS may block it on first launch. Run the following command in Terminal to fix this:
```
xattr -cr /Applications/Textream.app
```
Then open Textream normally.
Or install via Homebrew:
```
brew install f/textream/textream
```
- name: Compute DMG SHA256
id: sha
run: |
echo "sha256_26=$(shasum -a 256 artifacts/Textream.dmg | awk '{print $1}')" >> "$GITHUB_OUTPUT"
echo "sha256_15=$(shasum -a 256 artifacts/Textream-macos15.dmg | awk '{print $1}')" >> "$GITHUB_OUTPUT"
- name: Update Homebrew Cask tap
env:
TAP_REPO_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
VERSION: ${{ needs.version.outputs.tag }}
SHA256_26: ${{ steps.sha.outputs.sha256_26 }}
SHA256_15: ${{ steps.sha.outputs.sha256_15 }}
run: |
VERSION_NUM="${VERSION#v}"
git clone https://x-access-token:${TAP_REPO_TOKEN}@github.com/f/homebrew-textream.git tap
mkdir -p tap/Casks
cat > tap/Casks/textream.rb << CASKEOF
cask "textream" do
version "${VERSION_NUM}"
if MacOS.version >= :tahoe
sha256 "${SHA256_26}"
url "https://github.com/f/textream/releases/download/${VERSION}/Textream.dmg"
else
sha256 "${SHA256_15}"
url "https://github.com/f/textream/releases/download/${VERSION}/Textream-macos15.dmg"
end
name "Textream"
desc "macOS teleprompter that highlights your script in real-time as you speak"
homepage "https://github.com/f/textream"
depends_on macos: ">= :sequoia"
app "Textream.app"
postflight do
system_command "/usr/bin/xattr", args: ["-cr", "#{appdir}/Textream.app"]
end
zap trash: [
"~/Library/Preferences/dev.fka.Textream.plist",
"~/Library/Saved Application State/dev.fka.Textream.savedState",
]
end
CASKEOF
cd tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Update Textream to ${VERSION}"
git push