-
Notifications
You must be signed in to change notification settings - Fork 350
151 lines (146 loc) · 4.61 KB
/
upload.yaml
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: CI
on:
push:
branches: "*"
pull_request:
branches: "*"
jobs:
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install b2
run: pip install --upgrade b2
- name: Authorize b2
run: b2 authorize-account ${{ secrets.B2_KEYID }} ${{ secrets.B2_APPKEY }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable-i686-pc-windows-msvc
profile: minimal
default: true
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --locked
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
- name: Move built files
run: bash move_built.sh
- name: Sync to B2
run: b2 sync ./OUTPUT/ b2://geph-dl/geph4-binaries/
build_osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install b2
run: |
pip3 install --upgrade b2
- name: Authorize b2
run: b2 authorize-account ${{ secrets.B2_KEYID }} ${{ secrets.B2_APPKEY }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Add macOS targets
run: |
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Build x86_64 binary
run: cargo build --release --locked --target x86_64-apple-darwin
- name: Build arm64 binary
run: cargo build --release --locked --target aarch64-apple-darwin
- name: Combine binaries into a universal binary
run: |
mkdir -p universal_binary
lipo -create \
target/x86_64-apple-darwin/release/geph4-client \
target/aarch64-apple-darwin/release/geph4-client \
-output universal_binary/geph4-client
- name: Move built files
run: bash move_built.sh
- name: Sync to B2
run: b2 sync ./OUTPUT/ b2://geph-dl/geph4-binaries/
build_android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install b2
run: pip3 install --upgrade b2
- name: Authorize b2
run: b2 authorize-account ${{ secrets.B2_KEYID }} ${{ secrets.B2_APPKEY }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Add Android targets
run: |
rustup target add armv7-linux-androideabi
rustup target add aarch64-linux-android
- name: Setup Android NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r25b
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Build for armv7-linux-androideabi
run: |
cargo ndk -t armeabi-v7a -p 21 build --release
- name: Build for aarch64-linux-android
run: |
cargo ndk -t arm64-v8a -p 21 build --release
- name: Move built files
run: bash move_built.sh
- name: Sync to B2
run: b2 sync ./OUTPUT/ b2://geph-dl/geph4-binaries/
build_cross_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install b2
run: pip3 install --upgrade b2
- name: Authorize b2
run: b2 authorize-account ${{ secrets.B2_KEYID }} ${{ secrets.B2_APPKEY }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Install cross
run: cargo install cross --locked
- name: Build for armv7-unknown-linux-musleabihf
run: cross build --release --locked --target armv7-unknown-linux-musleabihf
- name: Build for x86_64-unknown-linux-musl
run: cross build --release --locked --target x86_64-unknown-linux-musl
- name: Move built files
run: sh move_built.sh
- name: Sync to B2
run: b2 sync ./OUTPUT/ b2://geph-dl/geph4-binaries/