-
Notifications
You must be signed in to change notification settings - Fork 6
43 lines (42 loc) · 1.41 KB
/
apple_darwin_release.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
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: macos-latest
steps:
- name: Cache shards
uses: actions/cache@v2
with:
path: ~/.cache/shards
key: ${{ runner.os }}-shards-${{ hashFiles('shard.yml') }}
restore-keys: ${{ runner.os }}-shards-
- name: Download source
uses: actions/checkout@v2
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
- name: Install shards
run: shards check || shards install
- name: Check formatting
run: crystal tool format --check
- name: Run tests
run: crystal spec --order=random --error-on-warnings
- name: package information
run: |
echo "BINARY_NAME=ws" >> $GITHUB_ENV
echo "PKG_ARCH=x86_64" >> $GITHUB_ENV
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: release binary
id: release
run: |
shards build --production --release --progress --no-debug
ASSERT_NAME=${BINARY_NAME}-${RELEASE_VERSION}-${PKG_ARCH}-apple-darwin.tar.gz
tar zcf ${ASSERT_NAME} bin/${BINARY_NAME} LICENSE
echo ::set-output name=ASSERT_NAME::${ASSERT_NAME}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.release.outputs.ASSERT_NAME }}