-
Notifications
You must be signed in to change notification settings - Fork 10
95 lines (76 loc) · 2.7 KB
/
release.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
name: Release
on:
release:
types:
- created
env:
RELEASE_BIN: pawn_json
RELEASE_ADDS: json.inc
RUST: stable-i686
jobs:
release-windows:
runs-on: windows-2019
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 artifact 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: Create an archive
run: |
cd .\artifacts
7z a json-windows.zip
- name: Upload to release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: artifacts\json-windows.zip
asset_name: json-windows.zip
asset_content_type: application/gzip
release-linux:
runs-on: ubuntu-latest
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: Create an archive
run: |
cd artifacts
7z a -ttar -so -an . | 7z a -si ./json-linux-x86.tar.gz
- name: Upload to release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: artifacts/json-linux-x86.tar.gz
asset_name: json-linux-x86.tar.gz
asset_content_type: application/gzip