This repository was archived by the owner on Jan 1, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (71 loc) · 2.85 KB
/
release.yml
File metadata and controls
80 lines (71 loc) · 2.85 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
name: Release and Update Homebrew Cask
on:
workflow_dispatch:
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@v6
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v6
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@v6
- 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 "floatpane-*.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 floatpane-${VERSION_NUMBER_NO_V}-arm64.dmg | cut -d' ' -f1)" >> $GITHUB_ENV
echo "X64_SHA=$(shasum -a 256 floatpane-${VERSION_NUMBER_NO_V}-x64.dmg | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Clone Homebrew tap repository
run: |
git clone https://x-access-token:${{ secrets.PAT }}@github.com/floatpane/floatpane-cask.git
- name: Update Cask file
run: |
cd floatpane-cask
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/floatpane.rb
sed -i "/on_arm do/,/end/ s/sha256 \".*\"/sha256 \"${{ env.ARM64_SHA }}\"/" Casks/floatpane.rb
sed -i "/on_intel do/,/end/ s/sha256 \".*\"/sha256 \"${{ env.X64_SHA }}\"/" Casks/floatpane.rb
- name: Commit and push changes
run: |
cd floatpane-cask
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add Casks/floatpane.rb
git commit -m "Update cask for floatpane version ${{ env.RELEASE_VERSION }}"
git push