add release script #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| runs-on: ubuntu-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 push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |