-
Notifications
You must be signed in to change notification settings - Fork 12
117 lines (115 loc) · 3.53 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Release
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
mantle/target/
key: ${{ runner.os }}-release-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build release binary
working-directory: mantle
run: cargo build --verbose --locked --release
- name: Zip binary
uses: thedoctor0/[email protected]
with:
filename: mantle-win64.zip
path: mantle/target/release/mantle.exe
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: mantle-win64
path: mantle-win64.zip
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
mantle/target/
key: ${{ runner.os }}-release-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Build release binary
working-directory: mantle
run: |
source $HOME/.cargo/env
cargo build --verbose --locked --release
env:
OPENSSL_STATIC: 1
- name: Zip binary
uses: thedoctor0/[email protected]
with:
filename: mantle-macos.zip
path: mantle/target/release/mantle
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: mantle-macos
path: mantle-macos.zip
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
mantle/target/
key: ${{ runner.os }}-release-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build release binary
working-directory: mantle
run: cargo build --locked --verbose --release
env:
OPENSSL_STATIC: 1
- name: Zip binary
uses: thedoctor0/[email protected]
with:
filename: mantle-linux.zip
path: mantle/target/release/mantle
- name: Upload binary artifact
uses: actions/upload-artifact@v2
with:
name: mantle-linux
path: mantle-linux.zip
- name: Generate schema
working-directory: mantle
run: cargo run --release --bin gen_schema > schema.json
- name: Upload schema artifact
uses: actions/upload-artifact@v2
with:
name: schema
path: mantle/schema.json
release:
runs-on: ubuntu-latest
needs: [windows, macos, linux]
steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Create release
uses: softprops/action-gh-release@v1
with:
# TODO: remove and add body_path once we have an automated release notes generator
draft: true
files: artifacts/*/*