-
-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (55 loc) · 1.96 KB
/
rust.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
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
RELEASE_BIN: tgconnector
RELEASE_ADDS: README.md LICENSE
jobs:
build:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux, windows]
include:
- build: linux
os: ubuntu-20.04
rust: stable-i686
- build: windows
os: windows-latest
rust: stable-i686
- build: ubuntu-latest
os: ubuntu-latest
rust: stable-i686
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install gcc-multilib libssl-dev:i386 -y
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-latest'
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash
- name: Build
run: cargo build --verbose --release
- name: Create artifact directory
run: mkdir artifacts
- name: Create archive for Linux
run: 7z a -ttar -so -an ./target/release/lib${{ env.RELEASE_BIN }}.so ${{ env.RELEASE_ADDS }} | 7z a -si ./artifacts/${{ env.RELEASE_BIN }}-linux-x86.tar.gz
if: matrix.os == 'ubuntu-20.04'
- name: Create archive for Ubuntu Latest
run: 7z a -ttar -so -an ./target/release/lib${{ env.RELEASE_BIN }}.so ${{ env.RELEASE_ADDS }} | 7z a -si ./artifacts/${{ env.RELEASE_BIN }}-ubuntu-latest-x86.tar.gz
if: matrix.os == 'ubuntu-latest'
- name: Create archive for Windows
run: 7z a -tzip ./artifacts/${{ env.RELEASE_BIN }}-windows-x86.zip ./target/release/${{ env.RELEASE_BIN }}.dll ${{ env.RELEASE_ADDS }}
if: matrix.os == 'windows-latest'
- uses: actions/upload-artifact@v1
name: Upload archive
with:
name: ${{ runner.os }}
path: artifacts/