git.iko.soy/parseable-macos
on master help sign in
Switch to timestamp-based versioning and automated releases (#36)

* Set app version to UTC timestamp of git commit Add a post-build script phase in project.yml that extracts the commit's UTC timestamp (format YYYYMMDD.HHMMSS) and writes it into the built app's CFBundleVersion and CFBundleShortVersionString via PlistBuddy. The script runs on every build (basedOnDependencyAnalysis: false) and silently falls back to the static version if git is unavailable. https://claude.ai/code/session_01HQVw4fPXwBxKxjcdBGQ77o * Convert prerelease to proper release with timestamp versioning - Replace the prerelease job with a proper release that tags each build with the commit's UTC timestamp (YYYYMMDD.HHMMSS), matching the app version set by the post-build script - Remove the old tag-based (v*) release job and trigger since versions are now derived automatically from commit timestamps - Update Homebrew cask to use the timestamp as version and releases/latest/download URL for always-current downloads https://claude.ai/code/session_01HQVw4fPXwBxKxjcdBGQ77o * Use version :latest in Homebrew cask, remove CI tap update With version :latest and sha256 :no_check the cask always fetches from the releases/latest/download URL without needing per-release tap updates. Remove the Update Homebrew cask CI step and add a static cask file to this repo that can be copied once into the homebrew-tap. https://claude.ai/code/session_01HQVw4fPXwBxKxjcdBGQ77o --------- Co-authored-by: Claude <noreply@anthropic.com>

commitce1ac79f9df8506e427a8354c857f84473805211 authoriko <mail@iko.soy> dateMon 16 Feb 2026, 01:25 (8 months ago) parent7eebda4
3 files changed+42−74
.github/workflows/build.yml+14−74 parseable-viewer.rb+19 project.yml+9
.github/workflows/build.yml+14−74
@@ -3,8 +3,6 @@ name: Build and Release
33on:
44 push:
55 branches: [master, main]
6− tags:
7− - 'v*'
86 pull_request:
97 branches: [master, main]
108
@@ -133,33 +131,38 @@ jobs:
133131 name: ParseableViewer-universal
134132 path: ParseableViewer-universal.zip
135133
136− prerelease:
134+ release:
137135 needs: create-universal
138136 runs-on: macos-15
139137 concurrency:
140138 group: release
141139 cancel-in-progress: false
142− if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
140+ if: github.event_name == 'push'
143141 permissions:
144142 contents: write
145143 steps:
144+ - name: Checkout
145+ uses: actions/checkout@v4
146+
147+ - name: Compute version from commit timestamp
148+ id: version
149+ run: |
150+ COMMIT_TIMESTAMP=$(TZ=UTC git log -1 --format='%cd' --date=format-local:'%Y%m%d.%H%M%S')
151+ echo "timestamp=$COMMIT_TIMESTAMP" >> "$GITHUB_OUTPUT"
152+
146153 - name: Download all artifacts
147154 uses: actions/download-artifact@v4
148155 with:
149156 path: artifacts
150157
151− - name: Create or update prerelease
158+ - name: Create release
152159 uses: softprops/action-gh-release@v2
153160 with:
154− tag_name: latest
155− name: Latest Build
161+ tag_name: ${{ steps.version.outputs.timestamp }}
162+ name: ${{ steps.version.outputs.timestamp }}
156163 body: |
157− Automated prerelease build from commit ${{ github.sha }}.
158−
159164 **Branch:** ${{ github.ref_name }}
160165 **Commit:** [`${{ github.sha }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
161− prerelease: true
162− make_latest: false
163166 files: |
164167 artifacts/ParseableViewer-arm64/ParseableViewer-arm64.zip
165168 artifacts/ParseableViewer-x86_64/ParseableViewer-x86_64.zip
@@ -167,66 +170,3 @@ jobs:
167170 env:
168171 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
169172
170− - name: Update Homebrew cask
171− env:
172− HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
173− run: |
174− SHA_ARM64=$(shasum -a 256 artifacts/ParseableViewer-arm64/ParseableViewer-arm64.zip | awk '{print $1}')
175− SHA_X86_64=$(shasum -a 256 artifacts/ParseableViewer-x86_64/ParseableViewer-x86_64.zip | awk '{print $1}')
176− SHORT_SHA="${GITHUB_SHA::7}"
177−
178− cat > /tmp/parseable-viewer.rb << CASK
179− cask "parseable-viewer" do
180− arch arm: "arm64", intel: "x86_64"
181−
182− version "$SHORT_SHA"
183− sha256 arm: "$SHA_ARM64", intel: "$SHA_X86_64"
184−
185− url "https://github.com/ilyakooo0/parseable-macos/releases/download/latest/ParseableViewer-#{arch}.zip"
186− name "Parseable Viewer"
187− desc "A macOS client for Parseable"
188− homepage "https://github.com/ilyakooo0/parseable-macos"
189−
190− app "Parseable Viewer.app"
191−
192− postflight do
193− system_command "/usr/bin/xattr",
194− args: ["-cr", "#{appdir}/Parseable Viewer.app"],
195− sudo: false
196− end
197− end
198− CASK
199−
200− # Push updated cask to homebrew-tap
201− cd "$(mktemp -d)"
202− git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/ilyakooo0/homebrew-tap.git" .
203− cp /tmp/parseable-viewer.rb Casks/parseable-viewer.rb
204− git config user.name "github-actions[bot]"
205− git config user.email "github-actions[bot]@users.noreply.github.com"
206− git add Casks/parseable-viewer.rb
207− git commit -m "Update parseable-viewer to ${SHORT_SHA}"
208− git push
209−
210− release:
211− needs: create-universal
212− runs-on: macos-15
213− if: startsWith(github.ref, 'refs/tags/v')
214− permissions:
215− contents: write
216− steps:
217− - name: Download all artifacts
218− uses: actions/download-artifact@v4
219− with:
220− path: artifacts
221−
222− - name: Create Draft Release
223− uses: softprops/action-gh-release@v2
224− with:
225− draft: true
226− generate_release_notes: true
227− files: |
228− artifacts/ParseableViewer-arm64/ParseableViewer-arm64.zip
229− artifacts/ParseableViewer-x86_64/ParseableViewer-x86_64.zip
230− artifacts/ParseableViewer-universal/ParseableViewer-universal.zip
231− env:
232− GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
parseable-viewer.rbnew file+19
@@ -0,0 +1,19 @@
1+cask "parseable-viewer" do
2+ arch arm: "arm64", intel: "x86_64"
3+
4+ version :latest
5+ sha256 :no_check
6+
7+ url "https://github.com/ilyakooo0/parseable-macos/releases/latest/download/ParseableViewer-#{arch}.zip"
8+ name "Parseable Viewer"
9+ desc "A macOS client for Parseable"
10+ homepage "https://github.com/ilyakooo0/parseable-macos"
11+
12+ app "Parseable Viewer.app"
13+
14+ postflight do
15+ system_command "/usr/bin/xattr",
16+ args: ["-cr", "#{appdir}/Parseable Viewer.app"],
17+ sudo: false
18+ end
19+end
project.yml+9
@@ -37,6 +37,15 @@ targets:
3737 Release:
3838 SWIFT_OPTIMIZATION_LEVEL: "-O"
3939 SWIFT_COMPILATION_MODE: "wholemodule"
40+ postBuildScripts:
41+ - script: |
42+ COMMIT_TIMESTAMP=$(TZ=UTC git log -1 --format='%cd' --date=format-local:'%Y%m%d.%H%M%S' 2>/dev/null)
43+ if [ -n "$COMMIT_TIMESTAMP" ]; then
44+ /usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${COMMIT_TIMESTAMP}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
45+ /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${COMMIT_TIMESTAMP}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
46+ fi
47+ name: Set Version from Git Commit Timestamp
48+ basedOnDependencyAnalysis: false
4049 entitlements:
4150 path: ParseableViewer/ParseableViewer.entitlements
4251