-
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (74 loc) · 2.5 KB
/
build-release.yaml
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
name: build-release
on:
push:
tags:
- '*'
branches:
- feat/actions
workflow_call:
jobs:
build:
runs-on: ${{ matrix.os.imageName }}
timeout-minutes: 30
strategy:
matrix:
rust_toolchain: ["stable"]
os:
- target_platform: x86_64-unknown-linux-gnu
imageName: ubuntu-latest
cross: "true"
- target_platform: x86_64-unknown-linux-musl
imageName: ubuntu-latest
cross: "true"
- target_platform: aarch64-unknown-linux-musl
imageName: ubuntu-latest
cross: "true"
- target_platform: x86_64-apple-darwin
imageName: "macOS-latest"
- target_platform: aarch64-apple-darwin
imageName: "macOS-latest"
- target_platform: x86_64-pc-windows-msvc
imageName: windows-latest
steps:
- uses: actions/checkout@v3
# - uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
with:
prefix-key: v2-rust
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
- uses: rui314/setup-mold@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust_toolchain }}
target: ${{ matrix.os.target_platform }}
override: true
profile: minimal
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- uses: davidB/rust-cargo-make@v1
- name: Make zip-release-ci-flow
id: zip-release-ci-flow
run: cargo make --disable-check-for-updates zip-release-ci-flow
env:
TARGET: ${{ matrix.os.target_platform }}
CROSS: ${{ matrix.os.cross }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.zip-release-ci-flow.outputs.dist_file_path }}
tag: ${{ steps.zip-release-ci-flow.outputs.dist_version }}
prerelease: ${{ github.ref == format('refs/tags/{0}', steps.zip-release-ci-flow.outputs.dist_version) }}
overwrite: true