fix: update sourceror #345
This file contains 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: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
commitlint: | |
runs-on: ubuntu-latest | |
name: commitlint | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Deps | |
run: yarn install | |
- name: Lint PR Title | |
run: yarn commitlint --from "${{ github.event.before }}" | |
release: | |
name: release | |
needs: commitlint | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: elixir | |
package-name: next_ls | |
bump-minor-pre-major: true | |
extra-files: | | |
flake.nix | |
draft: | |
needs: release | |
if: ${{ needs.release.outputs.release_created }} | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- run: gh release edit ${{ needs.release.outputs.tag_name }} --draft=true --repo='elixir-tools/next-ls' | |
build: | |
needs: [release, draft] | |
runs-on: macos-14 | |
if: ${{ needs.release.outputs.release_created }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: elixir-tools | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: nix develop --command bash -c 'mix local.hex --force' | |
- run: nix develop --command bash -c 'mix local.rebar --force' | |
- run: nix develop --command bash -c 'mix deps.get --only prod' | |
- run: chmod +x priv/cmd | |
- run: nix develop --command bash -c 'mix release' | |
env: | |
MIX_ENV: prod | |
- name: Create Checksum | |
run: | | |
cd ./burrito_out | |
chmod +x ./* | |
shasum -a 256 ./* > next_ls_checksums.txt | |
cd .. | |
- name: Upload to release | |
env: | |
GITHUB_TOKEN: ${{ secrets.token }} | |
run: gh release upload ${{ needs.release.outputs.tag_name }} ./burrito_out/* | |
publish: | |
name: publish | |
needs: [release, build] | |
runs-on: ubuntu-latest | |
env: | |
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 |