-
Notifications
You must be signed in to change notification settings - Fork 8
93 lines (82 loc) · 2.59 KB
/
upload-binaries.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: Upload Binaries
on:
release:
types: [created]
jobs:
upload:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- name: linux
os: ubuntu-latest
bin_file: lsp-ws-proxy
- name: macos
os: macos-latest
bin_file: lsp-ws-proxy
- name: windows
os: windows-latest
bin_file: lsp-ws-proxy.exe
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked
- run: cd target/release && tar czf ${{ matrix.bin_file }}.tar.gz ${{ matrix.bin_file }}
- name: Upload Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target/release/${{ matrix.bin_file }}.tar.gz
asset_name: lsp-ws-proxy_${{ matrix.name }}.tar.gz
asset_content_type: application/octet-stream
upload_musl:
runs-on: ubuntu-latest
env:
TARGET: x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-musl-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
profile: minimal
target: ${{ env.TARGET }}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --locked --target x86_64-unknown-linux-musl
- run: cd target/${{ env.TARGET }}/release && tar czf lsp-ws-proxy.tar.gz lsp-ws-proxy
- name: Upload Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target/${{ env.TARGET }}/release/lsp-ws-proxy.tar.gz
asset_name: lsp-ws-proxy_linux-musl.tar.gz
asset_content_type: application/octet-stream