@@ -11,41 +11,17 @@ jobs:
11
11
strategy :
12
12
fail-fast : false
13
13
matrix :
14
- include :
15
- - os : ubuntu-latest
16
- name : linux
17
- binary_path : target/x86_64-unknown-linux-musl/release
18
- binary_files : icx-proxy
19
- rust : 1.50.0 # gmiam/rust-musl-action@master is only at 1.50.0 now
20
- - os : macos-latest
21
- name : macos
22
- binary_path : target/release
23
- binary_files : icx-proxy
24
- rust : 1.55.0
14
+ rust : [ '1.55.0' ]
15
+ os : [ ubuntu-latest, macos-latest ]
16
+
25
17
steps :
26
- - uses : actions/checkout@master
18
+ - uses : actions/checkout@v2
27
19
28
20
- name : Setup environment variables
29
21
run : |
30
22
echo "SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
31
23
echo "OPENSSL_STATIC=yes" >> $GITHUB_ENV
32
- binaries=$(echo ${{ matrix.binary_files }} | xargs -n1 echo "--bin"|xargs)
33
- echo "cargo_build_ARGS<<END" >> $GITHUB_ENV
34
- echo "--locked --release $binaries" >> $GITHUB_ENV
35
- echo "END" >> $GITHUB_ENV
36
-
37
- - name : Static build
38
- uses : gmiam/rust-musl-action@master
39
- with :
40
- args : cargo build --target x86_64-unknown-linux-musl ${{ env.cargo_build_ARGS }}
41
- if : contains(matrix.os, 'ubuntu')
42
-
43
- - name : Strip binaries
44
- run : |
45
- cd ${{ matrix.binary_path }}
46
- sudo chown -R $(whoami) .
47
- strip ${{ matrix.binary_files }}
48
- if : contains(matrix.os, 'ubuntu')
24
+ echo ICX_VERSION=$(cargo metadata | jq -r '.["packages"][] | select(.name == "icx-proxy")["version"]') >> $GITHUB_ENV
49
25
50
26
- name : Install Rust toolchain
51
27
uses : actions-rs/toolchain@v1
@@ -55,15 +31,33 @@ jobs:
55
31
override : true
56
32
if : contains(matrix.os, 'macos')
57
33
58
- - name : Dynamic build
34
+ - name : Linux hack
59
35
run : |
60
- cargo build ${{ env.cargo_build_ARGS }}
61
- cd ${{ matrix.binary_path }}
62
- otool -L ${{ matrix.binary_files }}
36
+ echo "1.58.1" >./rust-toolchain
37
+ if : contains(matrix.os, 'ubuntu')
38
+
39
+ - name : Linux build
40
+ uses : dfinity/rust-musl-action@master
41
+ with :
42
+ args : |
43
+ cargo install cargo-deb --target x86_64-unknown-linux-musl
44
+ echo "1.55.0" >./rust-toolchain
45
+ rustup target add x86_64-unknown-linux-musl
46
+ RUSTFLAGS="--remap-path-prefix=${GITHUB_WORKSPACE}=/builds/dfinity" cargo deb --target x86_64-unknown-linux-musl -- --locked
47
+ if : contains(matrix.os, 'ubuntu')
48
+
49
+ - name : macOS build
50
+ env :
51
+ RUSTFLAGS : --remap-path-prefix=${GITHUB_WORKSPACE}=/builds/dfinity
52
+ run : |
53
+ cargo build --locked --release
54
+ cd target/release
55
+ otool -L icx-proxy
63
56
if : contains(matrix.os, 'macos')
64
57
65
58
- name : Create tarball of binaries
66
- run : tar -zcC ${{ matrix.binary_path }} -f binaries.tar.gz ${{ matrix.binary_files }}
59
+ run : tar -zcC target/release -f binaries.tar.gz icx-proxy
60
+ if : contains(matrix.os, 'macos')
67
61
68
62
- name : Upload tarball
69
63
uses : svenstaro/upload-release-action@v2
72
66
file : binaries.tar.gz
73
67
asset_name : binaries-${{ matrix.name }}.tar.gz
74
68
tag : ${{ env.SHA_SHORT }}
69
+ if : contains(matrix.os, 'macos')
70
+
71
+ - name : Upload deb
72
+ uses : svenstaro/upload-release-action@v2
73
+ with :
74
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
75
+ file : target/x86_64-unknown-linux-musl/debian/icx-proxy_${{ env.ICX_VERSION }}_amd64.deb
76
+ asset_name : icx-proxy.deb
77
+ tag : ${{ env.SHA_SHORT }}
78
+ if : contains(matrix.os, 'ubuntu')
0 commit comments