-
Notifications
You must be signed in to change notification settings - Fork 49
82 lines (66 loc) · 2.16 KB
/
build-rust-crates.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
---
name: Build Rust crates
on:
workflow_dispatch:
pull_request:
push:
branches:
- "master"
- "rc"
- "hotfix-rc"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Building ${{matrix.package}} for - ${{ matrix.os }}
runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
package:
- bitwarden
- bitwarden-api-api
- bitwarden-api-identity
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install rust
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # stable
with:
toolchain: stable
targets: ${{ matrix.settings.target }}
- name: Cache cargo registry
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
- name: Build
run: cargo build -p ${{ matrix.package }} --release
env:
RUSTFLAGS: "-D warnings"
- name: Build Internal
if: ${{ matrix.package == 'bitwarden' }}
run: cargo build -p ${{ matrix.package }} --features internal --release
env:
RUSTFLAGS: "-D warnings"
release-dry-run:
name: Release dry-run
runs-on: ubuntu-latest
if: ${{ github.ref == 'ref/head/master' || github.ref == 'ref/head/rc' || github.ref == 'ref/head/hotfix-rc' }}
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- name: Install rust
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # stable
with:
toolchain: stable
targets: ${{ matrix.settings.target }}
- name: Cache cargo registry
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
- name: Install cargo-release
run: cargo install cargo-release
- name: Cargo release dry run
run: cargo-release release publish -p bitwarden-api-api -p bitwarden-api-identity -p bitwarden