-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (65 loc) · 2.71 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
name: Release
on:
release:
types:
- published
jobs:
build:
strategy:
matrix:
platform: [windows-latest, ubuntu-16.04, macos-latest]
node: ['10']
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Checkout code
uses: actions/checkout@master
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo1073325810292-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Install llvm
if: matrix.platform=='windows-latest'
run: choco install -y llvm
- name: Install llvm
if: matrix.platform=='ubuntu-16.04'
run: sudo apt install llvm libclang-dev
- name: set environment variables
if: matrix.platform=='windows-latest'
run: echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $GITHUB_ENV
shell: bash
- name: Build
run: cargo build --release
working-directory: native
- name: Copy artifacts Linux
if: matrix.platform=='ubuntu-16.04'
run: cp ./native/target/release/libimageflow_node.so ./libimageflow-${{ matrix.platform }}.node
- name: Copy artifacts macos
if: matrix.platform=='macos-latest'
run: cp ./native/target/release/libimageflow_node.dylib ./libimageflow-${{ matrix.platform }}.node
- name: Copy artifacts windows
if: matrix.platform=='windows-latest'
run: cp ./native/target/release/imageflow_node.dll ./libimageflow-${{ matrix.platform }}.node
shell: bash
- name: Upload to release
uses: Shopify/upload-to-release@master
with:
name: libimageflow-${{ matrix.platform }}.node
path: libimageflow-${{ matrix.platform }}.node
repo-token: ${{ secrets.GITHUB_TOKEN }}
content-type: text/plain