-
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.51 KB
/
build.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: Build
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
RELEASE_BIN: samp_rng
RELEASE_ADDS: ./include/samp_rng.inc
jobs:
build:
name: Build
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
steps:
- uses: actions/checkout@v1
- name: Install gcc-multilib
run: |
sudo apt update
sudo apt install gcc-multilib -y
if: matrix.os == 'ubuntu-20.04'
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash
- name: Build
run: cargo build --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 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@v4
name: Upload archive
with:
name: ${{ runner.os }}
path: artifacts/