-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (44 loc) · 1.35 KB
/
cli.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CLI
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- name: Setup crystal (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: curl -fsSL https://crystal-lang.org/install.sh | sudo bash
- name: Setup crystal (Mac)
if: startsWith(matrix.os, 'macOS')
run: brew install crystal
- name: Install dependencies
run: cd cli && shards install
- name: Format check
run: cd cli && crystal tool format --check
- name: Ameba (static code analysis)
run: cd cli && bin/ameba
- name: Spec
run: cd cli && crystal spec
- name: Build
env:
OS_NAME: ${{ matrix.os }}
run: |
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl/lib/pkgconfig # for macOS
cd cli
crystal --version
shards build --release
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Release
if: startsWith(github.ref, 'refs/tags')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo npm install --global release-it
sudo chown -R $USER:$(id -gn $USER) /home/runner/.config
release-it --verbose --ci --no-increment