-
Notifications
You must be signed in to change notification settings - Fork 30
98 lines (88 loc) · 2.96 KB
/
release.yml
File metadata and controls
98 lines (88 loc) · 2.96 KB
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
name: Release
on:
push:
tags:
- "*"
pull_request:
env:
rust: 1.88.0
jobs:
build:
name: Release binary for ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
name: linux-musl
target: x86_64-unknown-linux-musl
target_file: target/x86_64-unknown-linux-musl/release/quill
asset_name: quill-linux-x86_64-musl
features: []
- os: windows-2022
name: windows
target_file: target/release/quill.exe
asset_name: quill-windows-x86_64.exe
- os: macos-15-intel
name: macos
target_file: target/release/quill
asset_name: quill-macos-x86_64
- os: macos-15
name: macos-arm64
target_file: target/release/quill
asset_name: quill-macos-arm64
- os: ubuntu-22.04
name: linux-arm32
target: arm-unknown-linux-gnueabihf
target_file: target/arm-unknown-linux-gnueabihf/release/quill
asset_name: quill-linux-arm32
features: [hsm]
- os: ubuntu-22.04
name: linux
target_file: target/release/quill
asset_name: quill-linux-x86_64
env:
VCPKG_ROOT: 'C:\vcpkg'
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.cargo/git
~/.cargo/registry
${{ env.VCPKG_ROOT }}
key: ${{ matrix.os }}-cargo-${{ env.rust }}-release-1
- name: Install libudev (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: sudo apt-get install -y libudev-dev
- name: Install target
if: ${{ matrix.target }}
run: rustup target add ${{ matrix.target }}
- if: ${{ matrix.target }}
uses: taiki-e/install-action@80e6af7a2ec7f280fffe2d0a9d3a12a9d11d86e9 # v2.75.1
with:
tool: cross@0.2.5
- name: Build
run: >
${{ matrix.target && 'cross' || 'cargo' }} build
${{ 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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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