-
Notifications
You must be signed in to change notification settings - Fork 6
92 lines (76 loc) · 2.43 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
name: release
on:
push:
tags:
- 'v*.*.*'
- 'rc-v*'
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
jobs:
build-ckb-bench:
name: Build ckb-bench
env:
PACKAGE: ckb-bench
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-20.04
- build: macos
os: macos-latest
- build: windows
os: windows-latest
steps:
- uses: actions/checkout@v2
- uses: olegtarasov/get-tag@v2.1
- name: Install windows dependencies (scoop)
run: |
iwr -useb get.scoop.sh -outfile 'install-scoop.ps1'
.\install-scoop.ps1 -RunAsAdmin
scoop install llvm
echo "LIBCLANG_PATH=$($HOME)/scoop/apps/llvm/current/bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if: matrix.os == 'windows-latest'
- name: Cargo build
run: cd ${{ env.PACKAGE }} && cargo build --release
- name: Install p7zip
run: brew install p7zip
if: matrix.os == 'macos-latest'
- name: Create artifact directory
run: mkdir artifacts
- name: Create archive for Linux
run: 7z a -ttar -so -an ./${{ env.PACKAGE }}/target/release/${{ env.PACKAGE }} | 7z a -si ./artifacts/${{ env.PACKAGE }}-linux-x86_64.tar.gz
if: matrix.os == 'ubuntu-20.04'
- name: Create archive for Windows
run: 7z a -tzip ./artifacts/${{ env.PACKAGE }}-windows-x86_64.zip ./${{ env.PACKAGE }}/target/release/${{ env.PACKAGE }}.exe
if: matrix.os == 'windows-latest'
- name: Create archive for MacOS
run: 7z a -tzip ./artifacts/${{ env.PACKAGE }}-mac-x86_64.zip ./${{ env.PACKAGE }}/target/release/${{ env.PACKAGE }}
if: matrix.os == 'macos-latest'
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ runner.os }}
path: artifacts/
release:
name: Release
runs-on: ubuntu-latest
needs: [ build-ckb-bench ]
steps:
- uses: actions/checkout@v2
- uses: olegtarasov/get-tag@v2.1
- run: mkdir artifacts/
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
./Linux/ckb-bench-*
./Windows/ckb-bench-*
./macOS/ckb-bench-*