forked from domo-iot/libp2p-rust-dht
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.53 KB
/
deploy.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
name: deploy
on:
push:
tags:
- 'v*.*.*'
jobs:
deploy-musl-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- name: Install protobuf compiler
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
- name: Install musl
run: |
sudo apt-get install musl-tools
- name: Build sifis-dht
run: |
# TODO: Remember to add RUSTFLAGS=+crt-static for musl target when
# static linkage will not be the default behaviour
cargo build --release --all-features --target x86_64-unknown-linux-musl
- name: Strip binary
run: |
strip target/x86_64-unknown-linux-musl/release/sifis-dht
- name: Get the version
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d@ -f2)
echo "tag=$VERSION" >> $GITHUB_OUTPUT
- name: Build package
run: |
TAR_FILE=sifis-dht-${{ steps.tagName.outputs.tag }}-x86_64-unknown-linux-musl
cd target/x86_64-unknown-linux-musl/release
tar -czvf $GITHUB_WORKSPACE/$TAR_FILE.tar.gz sifis-dht
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.tagName.outputs.tag }}
files: |
sifis-dht-${{ steps.tagName.outputs.tag }}-x86_64-unknown-linux-musl.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}