Skip to content

Add native scaffolding and Homebrew release path #24

Add native scaffolding and Homebrew release path

Add native scaffolding and Homebrew release path #24

Workflow file for this run

name: Build and Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: darwin-arm64
os: macos-latest
- target: linux-x86_64
os: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: latest
- name: Cache shards
uses: actions/cache@v4
with:
path: |
~/.cache/shards
./lib
key: ${{ runner.os }}-shards-${{ hashFiles('shard.lock') }}
restore-keys: |
${{ runner.os }}-shards-
- name: Install dependencies
run: shards install
- name: Build LSP binary for integration specs
run: |
mkdir -p bin
crystal build src/amber_lsp.cr --no-debug -o bin/amber-lsp
- name: Run tests
run: crystal spec
- name: Build binaries (Linux)
if: matrix.target == 'linux-x86_64'
run: |
crystal build src/amber_cli.cr -o amber --release --static
crystal build src/amber_lsp.cr -o amber-lsp --release --static
- name: Build binaries (macOS)
if: matrix.target == 'darwin-arm64'
run: |
crystal build src/amber_cli.cr -o amber --release
crystal build src/amber_lsp.cr -o amber-lsp --release
- name: Test binaries
run: |
./amber --version
./amber --help
./amber-lsp --help
- name: Upload build artifacts
uses: actions/upload-artifact@v7
if: github.event_name == 'workflow_dispatch'
with:
name: amber-cli-${{ matrix.target }}-build
path: |
amber
amber-lsp
retention-days: 7