-
Notifications
You must be signed in to change notification settings - Fork 1.3k
123 lines (117 loc) · 4.99 KB
/
releaser.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Releaser
on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
- 'v*.*.*-*'
jobs:
binary_linux_amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install cargo deps and build avail
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
sudo apt-get update && sudo apt-get install -y protobuf-compiler
cargo build --profile maxperf -p avail-light
mv target/maxperf/avail-light target/maxperf/avail-light-linux-amd64
pushd target/maxperf/
tar czf avail-light-linux-amd64.tar.gz avail-light-linux-amd64
popd
- uses: actions/upload-artifact@v2
with:
name: avail-light-linux-amd64-binary
path: target/maxperf/avail-light-linux-amd64.tar.gz
binary_linux_aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install cargo deps and build avail
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add aarch64-unknown-linux-gnu
sudo apt-get update && sudo apt-get install -y musl-tools clang gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev libc6-dev-arm64-cross libssl-dev pkg-config librust-openssl-dev build-essential protobuf-compiler
env BINDGEN_EXTRA_CLANG_ARGS='--sysroot /usr/aarch64-linux-gnu' CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo build --profile maxperf --target=aarch64-unknown-linux-gnu -p avail-light
mv target/aarch64-unknown-linux-gnu/maxperf/avail-light target/aarch64-unknown-linux-gnu/maxperf/avail-light-linux-aarch64
pushd target/aarch64-unknown-linux-gnu/maxperf/
tar czf avail-light-linux-aarch64.tar.gz avail-light-linux-aarch64
popd
- uses: actions/upload-artifact@v2
with:
name: avail-light-linux-aarch64-binary
path: target/aarch64-unknown-linux-gnu/maxperf/avail-light-linux-aarch64.tar.gz
binary_apple_arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: install cargo deps and build avail
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add aarch64-apple-darwin
cargo build --profile maxperf -p avail-light
mv target/maxperf/avail-light target/maxperf/avail-light-apple-arm64
pushd target/maxperf/
tar czf avail-light-apple-arm64.tar.gz avail-light-apple-arm64
popd
- uses: actions/upload-artifact@v2
with:
name: avail-light-apple-arm64-binary
path: target/maxperf/avail-light-apple-arm64.tar.gz
binary_apple_x86_64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: install cargo deps and build avail
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add x86_64-apple-darwin
cargo build --profile maxperf -p avail-light
mv target/maxperf/avail-light target/maxperf/avail-light-apple-x86_64
pushd target/maxperf/
tar czf avail-light-apple-x86_64.tar.gz avail-light-apple-x86_64
popd
- uses: actions/upload-artifact@v2
with:
name: avail-light-apple-x86_64-binary
path: target/maxperf/avail-light-apple-x86_64.tar.gz
# can extend binary publish 'needs' to include more releases i.e. arm64 in future
binary_publish:
needs: [binary_linux_amd64, binary_linux_aarch64, binary_apple_arm64, binary_apple_x86_64]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: avail-light-linux-amd64-binary
- uses: actions/download-artifact@v2
with:
name: avail-light-linux-aarch64-binary
- uses: actions/download-artifact@v2
with:
name: avail-light-apple-arm64-binary
- uses: actions/download-artifact@v2
with:
name: avail-light-apple-x86_64-binary
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: publish binaries
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.PAT_TOKEN }}
file: /home/runner/work/avail-light/avail-light/avail-light*
release_name: ${{ steps.prepare.outputs.tag_name }}
tag: ${{ steps.prepare.outputs.tag_name }}
overwrite: true
file_glob: true