-
Notifications
You must be signed in to change notification settings - Fork 5
113 lines (99 loc) · 3.41 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Build Test
on:
workflow_dispatch:
inputs:
name:
description: 'Log level'
required: true
default: 'warning'
jobs:
test:
name: build project
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux x86_64
- os: ubuntu-latest
# Windows
- os: windows-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: install_ubuntu_dependencies
if: startsWith(matrix.os, 'ubuntu-')
run: |
cargo install cross --git https://github.com/cross-rs/cross
- name: build_ubuntu
if: startsWith(matrix.os, 'ubuntu-')
run: |
CROSS_NO_WARNINGS=0 cross build --target i686-unknown-linux-musl --release
CROSS_NO_WARNINGS=0 cross build --target x86_64-unknown-linux-musl --release
CROSS_NO_WARNINGS=0 cross build --target aarch64-linux-android --release
CROSS_NO_WARNINGS=0 cross build --target aarch64-unknown-linux-musl --release
- name: build_windows
if: startsWith(matrix.os, 'windows-')
run: |
$ENV:RUSTFLAGS='-C target-feature=+crt-static'
rustup target add i686-pc-windows-msvc
rustup target add x86_64-pc-windows-msvc
cargo build --release --target i686-pc-windows-msvc
cargo build --release --target x86_64-pc-windows-msvc
shell: pwsh
- name: before_ubuntu_upload
if: startsWith(matrix.os, 'ubuntu-')
run: |
mkdir Release
cp target/x86_64-unknown-linux-musl/release/redlang Release/redlang_linux_x86_64
cp target/aarch64-linux-android/release/redlang Release/redlang_android_aarch64
cp target/aarch64-unknown-linux-musl/release/redlang Release/redlang_linux_aarch64
cp target/i686-unknown-linux-musl/release/redlang Release/redlang_linux_i686
- name: before_windows_upload
if: startsWith(matrix.os, 'windows-')
run: |
mkdir Release
cp target/i686-pc-windows-msvc/release/redlang.exe Release/redlang_windows_i686.exe
cp target/x86_64-pc-windows-msvc/release/redlang.exe Release/redlang_windows_x86_64.exe
shell: pwsh
- name: upload file1
if: startsWith(matrix.os, 'windows-')
uses: actions/upload-artifact@v3
with:
name: redlang_windows_i686.exe
path:
Release/redlang_windows_i686.exe
- name: upload file2
if: startsWith(matrix.os, 'windows-')
uses: actions/upload-artifact@v3
with:
name: redlang_windows_x86_64.exe
path:
Release/redlang_windows_x86_64.exe
- name: upload file3
if: startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v3
with:
name: redlang_linux_aarch64
path:
Release/redlang_linux_aarch64
- name: upload file4
if: startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v3
with:
name: redlang_linux_i686
path:
Release/redlang_linux_i686
- name: upload file5
if: startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v3
with:
name: redlang_android_aarch64
path:
Release/redlang_android_aarch64
- name: upload file6
if: startsWith(matrix.os, 'ubuntu-')
uses: actions/upload-artifact@v3
with:
name: redlang_linux_x86_64
path:
Release/redlang_linux_x86_64