Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,46 @@ jobs:
name: PostAI-Linux-x64
path: release/*.AppImage
retention-days: 7

# ============================================
# Update Homebrew cask on release
# ============================================
update-homebrew-cask:
runs-on: ubuntu-latest
needs: [build-electron-mac]
if: github.event_name == 'release'
steps:
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"

- name: Download DMG from release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download "${{ github.event.release.tag_name }}" \
--repo "${{ github.repository }}" \
--pattern "PostAI-*-arm64.dmg" \
--dir .

- name: Compute SHA256
id: sha
run: |
SHA=$(shasum -a 256 PostAI-*-arm64.dmg | awk '{print $1}')
echo "sha256=${SHA}" >> "$GITHUB_OUTPUT"

- name: Dispatch update to homebrew-tap
env:
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${TAP_GITHUB_TOKEN}" \
https://api.github.com/repos/Softorize/homebrew-tap/dispatches \
-d '{
"event_type": "update-postai",
"client_payload": {
"version": "${{ steps.version.outputs.version }}",
"sha256": "${{ steps.sha.outputs.sha256 }}"
}
}'
Loading