-
Notifications
You must be signed in to change notification settings - Fork 39
97 lines (93 loc) · 2.9 KB
/
artifacts.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
94
95
96
97
name: Build artifacts
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
strategy:
matrix:
build: [linux, windows, macos]
arch: [x86_64, aarch64]
include:
- build: linux
arch: x86_64
os: ubuntu-latest
platform: unknown-linux-musl
cross: false
name: linux-musl
features: --features vendored-openssl
- build: linux
arch: aarch64
os: ubuntu-latest
platform: unknown-linux-musl
cross: true
name: linux-musl
features: --features vendored-openssl
- build: windows
arch: x86_64
os: windows-latest
platform: pc-windows-msvc
cross: false
name: pc-windows
features:
- build: windows
arch: aarch64
os: windows-latest
platform: pc-windows-msvc
cross: false
name: pc-windows
features:
- build: macos
arch: x86_64
os: macos-latest
platform: apple-darwin
cross: false
name: macos-darwin
features:
- build: macos
arch: aarch64
os: macos-latest
platform: apple-darwin
cross: false
name: macos-darwin
features: --features vendored-openssl
runs-on: ${{ matrix.os }}
env:
# This variable can be overriden with `cross` for builds that
# requires it. By default, we will compile everything using cargo.
CARGO: cargo
steps:
- uses: actions/checkout@v3
- name: Install cross
if: matrix.cross == true
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
- name: Install target
if: matrix.cross == false
run: rustup target add ${{ matrix.arch }}-${{ matrix.platform }}
- name: Install deps (Linux)
if: ${{ matrix.build == 'linux' }}
run: |
sudo apt-get update
sudo apt-get install musl-tools
- name: Build
run: ${{env.CARGO}} build --verbose --release --target=${{ matrix.arch }}-${{ matrix.platform }} ${{ matrix.features }}
- name: Tarball
shell: bash
run: |
mkdir out
cp {README.md,LICENSE} out
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp "target/${{ matrix.arch }}-${{ matrix.platform }}/release/wws.exe" ./out
else
cp "target/${{ matrix.arch }}-${{ matrix.platform }}/release/wws" ./out
fi
tar czvf "wws-${{ matrix.name }}-${{ matrix.arch }}.tar.gz" -C ./out .
echo "TARBALL=wws-${{ matrix.name }}-${{ matrix.arch }}.tar.gz" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: wws-${{ matrix.name }}-${{ matrix.arch }}.tar.gz
path: ${{ env.TARBALL }}