-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (62 loc) · 2.59 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
name: build
on:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: true
matrix:
config:
- name: linux
arch: x86-64
os: ubuntu-latest
container: ubuntu:18.04
target: x86_64-unknown-linux-gnu
artifact_suffix: ""
# - name: windows
# arch: x86-64
# os: windows-latest
# target: x86_64-pc-windows-msvc
# artifact_suffix: ".exe"
- name: macos
arch: x86-64
os: macos-latest
target: x86_64-apple-darwin
artifact_suffix: ""
- name: macos
arch: arm64
os: macos-11
target: aarch64-apple-darwin
artifact_suffix: ""
name: ${{ matrix.config.name }}-${{ matrix.config.arch }}
runs-on: ${{ matrix.config.os }}
container: ${{ matrix.config.container }}
steps:
- name: Checkout
uses: actions/checkout@v3
# Since we use pure ubuntu container, it doesn't contain `curl` and `rustup`.
# So let's install them manually
- name: Install Rust toolchain dependencies
if: ${{ matrix.config.container == 'ubuntu:18.04' }}
shell: bash
run: |
apt-get update && apt-get install -y build-essential curl
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.config.target }}
default: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.config.target }}
- name: Publish
uses: actions/upload-artifact@v2
with:
name: ipfs-webdav_${{ matrix.config.name }}-${{ matrix.config.arch }}${{ matrix.config.artifact_suffix }}
path: target/${{ matrix.config.target }}/release/ipfs-webdav${{ matrix.config.artifact_suffix }}