forked from f/textream
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (150 loc) · 5.7 KB
/
Copy pathrelease.yml
File metadata and controls
178 lines (150 loc) · 5.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
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: ${{ github.ref }}
- 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