diff --git a/.github/workflows/brew.yaml b/.github/workflows/brew.yaml new file mode 100644 index 00000000..28d13544 --- /dev/null +++ b/.github/workflows/brew.yaml @@ -0,0 +1,18 @@ +name: Homebrew + +on: + push: + tags: + - 'v*' + +jobs: + homebrew: + runs-on: ubuntu-latest + steps: + - name: Bump Homebrew formula + uses: dawidd6/action-homebrew-bump-formula@v3 + with: + token: ${{secrets.GH_API_TOKEN}} + no_fork: true + tap: elixir-tools/tap + formula: next-ls diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 136535fc..2f839363 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -86,48 +86,3 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - run: gh release edit ${{ needs.release.outputs.tag_name }} --draft=false --repo='elixir-tools/next-ls' - - homebrew: - name: homebrew - needs: [publish, release] - runs-on: macos-14 - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Set up Homebrew - id: set-up-homebrew - uses: Homebrew/actions/setup-homebrew@master - - - name: Cache Homebrew Bundler RubyGems - id: cache - uses: actions/cache@v4 - with: - path: ${{ steps.set-up-homebrew.outputs.gems-path }} - key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} - restore-keys: ${{ runner.os }}-rubygems- - - - name: Tap formula - run: brew tap elixir-tools/tap - - name: Configure git - run: | - git config --unset-all http.https://github.com/.extraheader - git config --global user.name github-actions[bot] - git config --global user.email github-actions[bot]@users.noreply.github.com - - - name: Bump formula - env: - HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - formula="next-ls" - version="${{ needs.release.outputs.tag_name }}" - url="https://github.com/elixir-tools/$formula/archive/refs/tags/$version.tar.gz" - - sha="$(curl --silent -L "$url" | shasum -a 256 | cut -f 1 -d ' ' -)" - ( - cd "$(brew --repository elixir-tools/homebrew-tap)" - - git checkout main && git pull - ) - - brew bump-formula-pr "$formula" --url="$url" --sha256="$sha" --no-fork --no-browse