-
Notifications
You must be signed in to change notification settings - Fork 18
85 lines (73 loc) · 2.03 KB
/
ci.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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "full"
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, macos-11, ubuntu-20.04]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo
target
key: ${{ matrix.os }}
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install -y libgtk-3-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
cargo install cargo-bundle
rustup target install aarch64-apple-darwin
fi
shell: bash
- name: Test
run: cargo test --release
- name: Build
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
cargo bundle --release
cargo bundle --release --target aarch64-apple-darwin
mv target/release/bundle/osx/Gupax.app Gupax-macos-x64.app
mv target/aarch64-apple-darwin/release/bundle/osx/Gupax.app Gupax-macos-arm64.app
tar -cf macos.tar Gupax-macos-arm64.app Gupax-macos-x64.app
elif [ "$RUNNER_OS" == "Linux" ]; then
cargo build --release --target x86_64-unknown-linux-gnu
mv target/x86_64-unknown-linux-gnu/release/gupax .
tar -cf linux.tar gupax
else
cargo build --release
fi
shell: bash
- name: Archive (Windows)
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@v3
with:
name: windows
path: target/release/gupax.exe
- name: Archive
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v3
with:
name: macos
path: macos.tar
- name: Archive (Linux)
if: ${{ runner.os == 'Linux' }}
uses: actions/upload-artifact@v3
with:
name: linux
path: linux.tar