-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.19 KB
/
release.yml
File metadata and controls
32 lines (30 loc) · 1.19 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: make build
- name: Create Release
run: gh release create ${{ github.ref_name }} --generate-notes adaptive-scroll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Homebrew Formula
run: |
git clone https://github.com/narasaka/homebrew-tap.git tap
cd tap
SHA256=$(shasum -a 256 ../adaptive-scroll | cut -d' ' -f1)
sed -i '' "s|url .*|url \"https://github.com/narasaka/adaptive-scroll/releases/download/${{ github.ref_name }}/adaptive-scroll\"|" adaptive-scroll.rb
sed -i '' "s|sha256 .*|sha256 \"$SHA256\"|" adaptive-scroll.rb
sed -i '' "s|version .*|version \"${{ github.ref_name }}\"|" adaptive-scroll.rb
git add adaptive-scroll.rb
git commit -m "Update adaptive-scroll to ${{ github.ref_name }}"
git remote set-url origin https://x-access-token:${{ secrets.HOMEBREW_TOKEN }}@github.com/narasaka/homebrew-tap.git
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}