-
Notifications
You must be signed in to change notification settings - Fork 3
75 lines (71 loc) · 2.7 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
name: build
on:
push:
tags:
- 'v*.*.*'
env:
CARGO_TERM_COLOR: always
jobs:
build_linux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: yum -y install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Add targets
run: rustup target add x86_64-unknown-linux-gnu && rustup target add i686-unknown-linux-gnu
- name: Build 32-bit
run: export CC=$(which gcc) && cargo build --release --target i686-unknown-linux-gnu
- name: Build 64-bit
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Strip debug symbols
run: |
strip target/i686-unknown-linux-gnu/release/libdot_env.so
strip target/x86_64-unknown-linux-gnu/release/libdot_env.so
- name: Rename binaries
run: |
mv target/i686-unknown-linux-gnu/release/libdot_env.so target/i686-unknown-linux-gnu/release/gmsv_dot_env_linux.dll
mv target/x86_64-unknown-linux-gnu/release/libdot_env.so target/x86_64-unknown-linux-gnu/release/gmsv_dot_env_linux64.dll
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
target/i686-unknown-linux-gnu/release/gmsv_dot_env_linux.dll
target/x86_64-unknown-linux-gnu/release/gmsv_dot_env_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
- 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/dot_env.dll target/i686-pc-windows-msvc/release/gmsv_dot_env_win32.dll
mv target/x86_64-pc-windows-msvc/release/dot_env.dll target/x86_64-pc-windows-msvc/release/gmsv_dot_env_win64.dll
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
target/i686-pc-windows-msvc/release/gmsv_dot_env_win32.dll
target/x86_64-pc-windows-msvc/release/gmsv_dot_env_win64.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}