fix(credo): calculate accurate span from trigger (#427) #373
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/* | |
nix-build: | |
name: build nix flakes and push to cachix | |
needs: [release, draft] | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-13, macos-14] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v26 | |
with: | |
github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: elixir-tools | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
- run: nix build --accept-flake-config | |
- run: nix flake check --accept-flake-config | |
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: | |
needs: [publish] | |
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 |