Skip to content

Commit 4f5432f

Browse files
committed
feat: enhance release workflow with manifest updates for Scoop and Homebrew
1 parent 70b3223 commit 4f5432f

1 file changed

Lines changed: 78 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,81 @@ jobs:
8080
uses: softprops/action-gh-release@v2
8181
with:
8282
body_path: RELEASE_NOTES.md
83-
files: dist/*
83+
files: dist/*
84+
85+
- name: extract version
86+
id: version
87+
run: |
88+
VERSION=${GITHUB_REF_NAME#v}
89+
echo "version=$VERSION" >> $GITHUB_OUTPUT
90+
91+
- name: calculate scoop sha256
92+
id: scoop-sha256
93+
run: |
94+
SHA256=$(sha256sum dist/komorebi-switcher.exe | cut -d ' ' -f 1)
95+
echo "hash=$SHA256" >> $GITHUB_OUTPUT
96+
97+
- name: checkout scoop-bucket
98+
uses: actions/checkout@v4
99+
with:
100+
repository: amrbashir/scoop-bucket
101+
token: ${{ secrets.SCOOP_BUCKET_PAT }}
102+
path: scoop-bucket
103+
104+
- name: update scoop manifest
105+
run: |
106+
cd scoop-bucket
107+
sed -i 's/"version": ".*"/"version": "${{ steps.version.outputs.version }}"/' bucket/komorebi-switcher.json
108+
sed -i 's|"url": ".*"|"url": "https://github.com/amrbashir/komorebi-switcher/releases/download/v${{ steps.version.outputs.version }}/komorebi-switcher.exe"|' bucket/komorebi-switcher.json
109+
sed -i 's/"hash": ".*"/"hash": "${{ steps.scoop-sha256.outputs.hash }}"/' bucket/komorebi-switcher.json
110+
111+
- name: create scoop pull request
112+
uses: peter-evans/create-pull-request@v5
113+
with:
114+
token: ${{ secrets.SCOOP_BUCKET_PAT }}
115+
path: scoop-bucket
116+
commit-message: "komorebi-switcher: Update to ${{ steps.version.outputs.version }}"
117+
branch: update-komorebi-switcher-${{ steps.version.outputs.version }}
118+
title: "komorebi-switcher: Update to ${{ steps.version.outputs.version }}"
119+
body: |
120+
Update komorebi-switcher to version ${{ steps.version.outputs.version }}
121+
122+
- Version: ${{ steps.version.outputs.version }}
123+
- SHA256: ${{ steps.scoop-sha256.outputs.hash }}
124+
125+
Auto-generated by release workflow.
126+
127+
- name: calculate homebrew sha256
128+
id: homebrew-sha256
129+
run: |
130+
SHA256=$(sha256sum dist/komorebi-switcher.dmg | cut -d ' ' -f 1)
131+
echo "hash=$SHA256" >> $GITHUB_OUTPUT
132+
133+
- name: checkout homebrew-tap
134+
uses: actions/checkout@v4
135+
with:
136+
repository: amrbashir/homebrew-tap
137+
token: ${{ secrets.HOMEBREW_TAP_PAT }}
138+
path: homebrew-tap
139+
140+
- name: update homebrew cask
141+
run: |
142+
cd homebrew-tap
143+
sed -i 's/version ".*"/version "${{ steps.version.outputs.version }}"/' Casks/komorebi-switcher.rb
144+
sed -i 's/sha256 ".*"/sha256 "${{ steps.homebrew-sha256.outputs.hash }}"/' Casks/komorebi-switcher.rb
145+
146+
- name: create homebrew pull request
147+
uses: peter-evans/create-pull-request@v5
148+
with:
149+
token: ${{ secrets.HOMEBREW_TAP_PAT }}
150+
path: homebrew-tap
151+
commit-message: "komorebi-switcher: Update to ${{ steps.version.outputs.version }}"
152+
branch: update-komorebi-switcher-${{ steps.version.outputs.version }}
153+
title: "komorebi-switcher: Update to ${{ steps.version.outputs.version }}"
154+
body: |
155+
Update komorebi-switcher to version ${{ steps.version.outputs.version }}
156+
157+
- Version: ${{ steps.version.outputs.version }}
158+
- SHA256: ${{ steps.homebrew-sha256.outputs.hash }}
159+
160+
Auto-generated by release workflow.

0 commit comments

Comments
 (0)