-
Notifications
You must be signed in to change notification settings - Fork 29
102 lines (93 loc) · 3.03 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
name: Release
on:
push:
tags:
- "*"
pull_request:
env:
rust: 1.75.0
jobs:
build:
name: Release binary for ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
name: linux-musl
target: x86_64-unknown-linux-musl
cross: true
target_file: target/x86_64-unknown-linux-musl/release/quill
asset_name: quill-linux-x86_64-musl
features: []
- os: windows-2019
name: windows
target_file: target/release/quill.exe
asset_name: quill-windows-x86_64.exe
build_deps: scripts/workflows/provision-windows-build.ps1
- os: macos-12-large
name: macos
target_file: target/release/quill
asset_name: quill-macos-x86_64
build_deps: scripts/workflows/provision-darwin-build.sh
- os: macos-13-xlarge
name: macos-arm64
target_file: target/release/quill
asset_name: quill-macos-arm64
build_deps: scripts/workflows/provision-darwin-arm64-build.sh
- os: ubuntu-20.04
name: linux-arm32
target: arm-unknown-linux-gnueabihf
cross: true
target_file: target/arm-unknown-linux-gnueabihf/release/quill
asset_name: quill-linux-arm32
features: [hsm]
- os: ubuntu-20.04
name: linux
target_file: target/release/quill
asset_name: quill-linux-x86_64
build_deps: scripts/workflows/provision-linux-build.sh
env:
VCPKG_ROOT: 'C:\vcpkg'
steps:
- uses: actions/checkout@master
- uses: actions/cache@v3
with:
path: |
~/.cargo/git
~/.cargo/registry
${{ env.VCPKG_ROOT }}
key: ${{ matrix.os }}-cargo-${{ env.rust }}-release-1
- name: Install dependencies
if: ${{ matrix.build_deps }}
run: ${{ matrix.build_deps }}
- name: Install target
if: ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.cross }}
command: build
args: |
${{ matrix.target && format('--target {0}', matrix.target) }}
${{ matrix.features && format('--no-default-features --features "{0}"', join(matrix.features)) }}
--release --locked
- name: Upload binaries to release
if: ${{ github.ref_type == 'tag' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.target_file }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
aggregate:
name: release:required
needs: [build]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: check result
if: ${{ needs.build.result != 'success' }}
run: exit 1