-
Notifications
You must be signed in to change notification settings - Fork 6
88 lines (83 loc) · 3.35 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
80
81
82
83
84
85
86
87
88
name: build
on:
push:
tags:
- "v*.*.*"
env:
CARGO_TERM_COLOR: always
jobs:
build_linux32:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_i686
defaults:
run:
shell: sh
steps:
- uses: actions/checkout@v1
- name: Install Rust
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-host i686-unknown-linux-gnu --default-toolchain nightly-2023-01-01 --profile minimal -y
- name: Build 32-bit
run: |
source $HOME/.cargo/env
cargo build --release --target i686-unknown-linux-gnu
- name: Strip debug symbols
run: strip target/i686-unknown-linux-gnu/release/libgmsv_reqwest.so
- name: Rename binaries
run: mkdir target/i686-unknown-linux-gnu/release/bin && mv target/i686-unknown-linux-gnu/release/libgmsv_reqwest.so target/i686-unknown-linux-gnu/release/bin/gmsv_reqwest_linux.dll
- name: Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: target/i686-unknown-linux-gnu/release/bin
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
build_linux64:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2023-01-01
override: true
- name: Build 64-bit
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Strip debug symbols
run: strip target/x86_64-unknown-linux-gnu/release/libgmsv_reqwest.so
- name: Rename binaries
run: mv target/x86_64-unknown-linux-gnu/release/libgmsv_reqwest.so target/x86_64-unknown-linux-gnu/release/gmsv_reqwest_linux64.dll
- name: Release
uses: softprops/action-gh-release@v1
with:
files: target/x86_64-unknown-linux-gnu/release/gmsv_reqwest_linux64.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install nightly toolchain
run: rustup toolchain install nightly-2023-01-01
- name: Add targets
run: rustup target add x86_64-pc-windows-msvc && rustup target add i686-pc-windows-msvc
- name: Build 64-bit
run: cargo build --release --target x86_64-pc-windows-msvc
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
- name: Build 32-bit
run: cargo build --release --target i686-pc-windows-msvc
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
- name: Rename binaries
run: |
mv target/i686-pc-windows-msvc/release/gmsv_reqwest.dll target/i686-pc-windows-msvc/release/gmsv_reqwest_win32.dll
mv target/x86_64-pc-windows-msvc/release/gmsv_reqwest.dll target/x86_64-pc-windows-msvc/release/gmsv_reqwest_win64.dll
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
target/i686-pc-windows-msvc/release/gmsv_reqwest_win32.dll
target/x86_64-pc-windows-msvc/release/gmsv_reqwest_win64.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}