-
Notifications
You must be signed in to change notification settings - Fork 87
85 lines (79 loc) · 3.35 KB
/
cd.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
name: Build and Release
on:
push:
tags:
- "v*"
jobs:
# This builds and releases for Windows, MacOS, and Linux
usu-build-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: perseus
asset_name: perseus-linux-amd64
- os: macos-latest
artifact_name: perseus
asset_name: perseus-macos-amd64
- os: windows-latest
artifact_name: perseus.exe
asset_name: perseus-windows-amd64
steps:
- uses: actions/checkout@v2
# Cache Cargo binaries
- uses: actions/cache@v3
id: cache
with:
path: |
~/.cargo/bin/
# The cache should be OS-specific
key: ${{ runner.os }}-cargo-bins
# Only install the binaries if the cache doesn't have them
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: cargo install bonnie rust-script
- name: Build
run: cargo build --release
working-directory: packages/perseus-cli
- name: Release binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
body: "The below binaries/executables are for the Perseus CLI. See [CHANGELOG.md](./CHANGELOG.md) for details of the changes in this version."
# This builds and releases for musl
musl-build-release:
runs-on: ubuntu-latest # We cross-compile from Ubuntu
steps:
- uses: actions/checkout@v2
# Cache Cargo binaries
- uses: actions/cache@v3
id: cache
with:
path: |
~/.cargo/bin/
# The cache should be OS-specific
key: ${{ runner.os }}-cargo-bins
# Only install the binaries if the cache doesn't have them
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: cargo install bonnie rust-script
- run: sudo apt install musl-tools
- name: Install musl toolchain
run: rustup target add x86_64-unknown-linux-musl
- name: Prepare OpenSSL for cross-compilation
run: bash scripts/build_openssl_musl.sh
- name: Build
run: cargo build --release --target x86_64-unknown-linux-musl
working-directory: packages/perseus-cli
- name: Release binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/x86_64-unknown-linux-musl/release/perseus
asset_name: perseus-musl-amd64
tag: ${{ github.ref }}
body: "The above binaries/executables are for the Perseus CLI. See [CHANGELOG.md](./CHANGELOG.md) for details of the changes in this version."