Skip to content
This repository was archived by the owner on Jan 1, 2026. It is now read-only.

fix: version patter #17

fix: version patter

fix: version patter #17

Workflow file for this run

name: Release and Update Homebrew Cask
on:
push:
branches:
- master
jobs:
release:
runs-on: macos-latest
permissions:
contents: write
pull-requests: write
outputs:
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- name: Install dependencies
run: npm install
- name: Semantic Release
id: semantic
uses: cycjimmy/semantic-release-action@v4
with:
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-homebrew-cask:
name: Update Homebrew Cask
needs: release
if: needs.release.outputs.new_release_version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set Release Version Env
run: echo "RELEASE_VERSION=${{ needs.release.outputs.new_release_version }}" >> $GITHUB_ENV
- name: Download release assets
run: |
gh release download v${{ env.RELEASE_VERSION }} --pattern "Floatplane-*.dmg" --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Calculate checksums
run: |
VERSION_NUMBER=${{ env.RELEASE_VERSION }}
# Remove 'v' prefix for filename, which matches your electron-builder artifactName
VERSION_NUMBER_NO_V=${VERSION_NUMBER#v}
echo "ARM64_SHA=$(shasum -a 256 Floatplane-${VERSION_NUMBER_NO_V}-arm64.dmg | cut -d' ' -f1)" >> $GITHUB_ENV
echo "X64_SHA=$(shasum -a 256 Floatplane-${VERSION_NUMBER_NO_V}-x64.dmg | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Clone Homebrew tap repository
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/andrinoff/homebrew-floatplane.git
- name: Update Cask file
run: |
cd homebrew-floatplane
VERSION_NUMBER=${{ env.RELEASE_VERSION }}
# Remove 'v' prefix from version tag for the cask file
VERSION_NUMBER_NO_V=${VERSION_NUMBER#v}
sed -i "s/version \".*\"/version \"${VERSION_NUMBER_NO_V}\"/" Casks/floatplane.rb
sed -i "/on_arm do/,/end/ s/sha256 \".*\"/sha256 \"${{ env.ARM64_SHA }}\"/" Casks/floatplane.rb
sed -i "/on_intel do/,/end/ s/sha256 \".*\"/sha256 \"${{ env.X64_SHA }}\"/" Casks/floatplane.rb
- name: Commit and push changes
run: |
cd homebrew-floatplane
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add Casks/floatplane.rb
git commit -m "Update cask for Floatplane version ${{ env.RELEASE_VERSION }}"
git push