This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (98 loc) · 3.14 KB
/
rust.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
name: Rust
on:
push:
branches: [ "rewrite" ]
pull_request:
branches: [ "rewrite" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
MODIO_API_KEY: ${{ secrets.MODIO_API_KEY }}
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test --release --verbose
- name: Build for Windows
run: cargo build --release --verbose
- name: Upload Windows build artifact
uses: actions/upload-artifact@v3
with:
name: bonelab_mod_manager-${{ runner.os }}
path: target/release/bonelab_mod_manager.exe
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test --release --verbose
- name: Build for macOS (Intel)
run: cargo build --release --target x86_64-apple-darwin --verbose
- name: Install Apple Silicon Mac Rust target
run: rustup target add aarch64-apple-darwin
- name: Build for macOS (Apple Silicon)
run: cargo build --release --target aarch64-apple-darwin --verbose
- name: Merge two executables into universal exectuable
run: |
lipo \
target/x86_64-apple-darwin/release/bonelab_mod_manager \
target/aarch64-apple-darwin/release/bonelab_mod_manager \
-create \
-output "Bonelab Mod Manager Installer/Bonelab Mod Manager.app/Contents/Resources/bonelab_mod_manager"
- name: Make Applications alias
run: ln -s /Applications "Bonelab Mod Manager Installer"
- name: Make DMG from folder
run: |
hdiutil \
create \
-srcfolder "Bonelab Mod Manager Installer" \
bonelab_mod_manager.dmg
- name: Upload macOS build artifact
uses: actions/upload-artifact@v3
with:
name: bonelab_mod_manager-${{ runner.os }}
path: bonelab_mod_manager.dmg
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test --release --verbose
- name: Build for Linux
run: cargo build --release --verbose
- name: Tar executable
run: tar -czvf bonelab_mod_manager.tar.gz -C target/release bonelab_mod_manager
- name: Upload Linux build artifact
uses: actions/upload-artifact@v3
with:
name: bonelab_mod_manager-${{ runner.os }}
path: bonelab_mod_manager.tar.gz