-
-
Notifications
You must be signed in to change notification settings - Fork 120
93 lines (78 loc) · 2.88 KB
/
build.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
name: Build
on: [push, pull_request]
jobs:
Build:
strategy:
matrix:
include:
- arch: x86_64-linux
target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
- arch: arm64-linux
target: aarch64-unknown-linux-gnu
os: ubuntu-22.04
- arch: x86_64-macos
target: x86_64-apple-darwin
os: macos-latest
- arch: arm64-macos
target: aarch64-apple-darwin
os: macos-latest
fail-fast: false
name: Build (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
steps:
- if: startsWith(matrix.os, 'ubuntu')
run: sudo apt install -y libssl-dev pkg-config
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: rlespinasse/github-slug-action@v4.4.1
- uses: actions-rs/toolchain@v1
with:
target: ${{ matrix.target }}
override: true
- uses: Swatinem/rust-cache@v2
with:
key: "build"
- name: Install just
run: |
cargo install just
- name: Install admin UI deps
run: |
just yarn --network-timeout 1000000000
- name: Build admin UI
run: |
just yarn build
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: true
args: --all-features --release --target ${{ matrix.target }}
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "--cfg tokio_unstable"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "--cfg tokio_unstable"
CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS: "--cfg tokio_unstable"
CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS: "--cfg tokio_unstable"
# env:
# CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C target-feature=+crt-static --cfg tokio_unstable"
# CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C target-feature=+crt-static --cfg tokio_unstable"
# CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS: "-C target-feature=+crt-static --cfg tokio_unstable"
# CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS: "-C target-feature=+crt-static --cfg tokio_unstable"
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}
path: target/${{ matrix.target }}/release/warpgate
- name: Rename artifact
run: |
mkdir dist
mv target/${{ matrix.target }}/release/warpgate dist/warpgate-${{ env.GITHUB_REF_SLUG }}-${{ matrix.arch }}
- name: Upload release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
generate_release_notes: true
files: dist/*
token: ${{ secrets.GITHUB_TOKEN }}