-
Notifications
You must be signed in to change notification settings - Fork 11
79 lines (62 loc) · 2.02 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Build
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
env:
RELEASE_BIN: pawn_json
RELEASE_ADDS: json.inc
RUST: stable-i686
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust (rustup)
run: rustup update ${{ env.RUST }} --no-self-update && rustup default ${{ env.RUST }}
- name: Build
run: cargo build --release
- name: Rename binary
run: cp .\target\release\${{ env.RELEASE_BIN }}.dll .\target\release\json.dll
- name: Create artifacts directory
run: |
mkdir artifacts/plugins
mkdir artifacts/pawno/include
- name: Copy files to artifacts directory
run: |
cp .\target\release\json.dll .\artifacts\plugins\json.dll
cp .\${{ env.RELEASE_ADDS }} .\artifacts\pawno\include\${{ env.RELEASE_ADDS }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: json-windows
path: artifacts/
build-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install gcc-multilib
run: sudo apt update && sudo apt install gcc-multilib -y
- name: Install Rust (rustup)
run: rustup update ${{ env.RUST }} --no-self-update && rustup default ${{ env.RUST }}
- name: Build
run: cargo build --release
- name: Rename binary
run: cp target/release/lib${{ env.RELEASE_BIN }}.so target/release/json.so
- name: Create artifacts directory
run: |
mkdir -p artifacts/plugins
mkdir -p artifacts/pawno/include
- name: Copy files to artifacts directory
run: |
cp target/release/json.so artifacts/plugins/json.so
cp ${{ env.RELEASE_ADDS }} artifacts/pawno/include/${{ env.RELEASE_ADDS }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: json-linux
path: artifacts/