-
-
Notifications
You must be signed in to change notification settings - Fork 25
82 lines (80 loc) · 2.73 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release
on:
push:
tags:
- "v*"
jobs:
macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Crystal
env:
HOMEBREW_NO_INSTALL_UPGRADE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: brew update && brew install openssl crystal
- name: Install dependencies
run: shards install --production --ignore-crystal-version
- name: Build the binary
env:
LLVM_CONFIG: /usr/local/opt/llvm@17/bin/llvm-config
run: shards build crystalline --release --no-debug -Dpreview_mt --stats --progress --ignore-crystal-version
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: crystalline_x86_64-apple-darwin
path: ./bin/crystalline
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build the static binary
run: docker build -t crystalline .
- name: Copy binary to host
run: |
docker run -v $PWD:/app/host --rm crystalline:latest cp ./bin/crystalline ./host/crystalline
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: crystalline_x86_64-unknown-linux-musl
path: ./crystalline
release:
needs: [macos, linux]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: ./artifacts
- name: Compress artifacts
run: gzip -r ./artifacts
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Attach linux binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/crystalline_x86_64-unknown-linux-musl/crystalline.gz
asset_name: crystalline_x86_64-unknown-linux-musl.gz
asset_content_type: application/gzip
- name: Attach macOS binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/crystalline_x86_64-apple-darwin/crystalline.gz
asset_name: crystalline_x86_64-apple-darwin.gz
asset_content_type: application/gzip