-
Notifications
You must be signed in to change notification settings - Fork 43
81 lines (80 loc) · 2.72 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
name: build
on:
push:
paths-ignore: ["**.md"]
branches: [ master ]
pull_request:
paths-ignore: ["**.md"]
branches: [ master ]
jobs:
build-all:
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-pc-windows-gnu
- x86_64-linux-android
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- aarch64-linux-android
- armv7-unknown-linux-gnueabi
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabi
- armv7-unknown-linux-musleabihf
- armv7-linux-androideabi
- arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- armv7-linux-androideabi
os: [ubuntu-20.04]
cross: [true]
include:
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: false
- target: x86_64-apple-darwin
os: macos-latest
cross: false
- target: aarch64-apple-darwin
os: macos-latest
cross: false
- target: aarch64-apple-ios
os: macos-latest
cross: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.target }}
- name: install cross
if: ${{ matrix.cross }}
run: cargo install cross --git https://github.com/cross-rs/cross
- name: build cross
if: ${{ matrix.cross }}
run: cross build --release -p kaminari-cmd --target=${{ matrix.target }}
- name: build native
if: ${{ !matrix.cross }}
run: cargo build --release -p kaminari-cmd --target=${{ matrix.target }}
- name: pack unix
if: "!contains(matrix.target, 'windows')"
run: |
mkdir -p build-${{ matrix.target }}
cd build-${{ matrix.target }}
tar -C ../target/${{ matrix.target }}/release -zcf kaminari-${{ matrix.target }}.tar.gz kaminaris kaminaric
- name: pack windows
if: "contains(matrix.target, 'windows')"
run: |
mkdir -p build-${{ matrix.target }}
cd build-${{ matrix.target }}
tar -C ../target/${{ matrix.target }}/release -zcf kaminari-${{ matrix.target }}.tar.gz kaminaris.exe kaminaric.exe
- name: upload
uses: actions/upload-artifact@v3
with:
name: kaminari-${{ matrix.target }}.tar.gz
path: build-${{ matrix.target }}/kaminari-${{ matrix.target }}.tar.gz