-
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (94 loc) · 3.27 KB
/
mac-universal.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
on:
push:
branches:
- 'master'
name: 'Build: macOS (Universal)'
jobs:
mac_universal:
name: macOS (Universal)
runs-on: macos-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
- name: Install development dependencies
run: |
brew install openssl@3 openssl@1.1 > /dev/null
- name: Setup Rust toolchain for AMD64
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: x86_64-apple-darwin
default: true
profile: minimal
- name: Setup Rust toolchain for ARM64
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: aarch64-apple-darwin
default: false
profile: minimal
- name: Build Vaultist for AMD64
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --release --target x86_64-apple-darwin
- name: Build Vaultist for AARCH64
run: |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) \
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) \
OPENSSL_DIR=$(brew --prefix openssl) \
cargo build --release --target=aarch64-apple-darwin
- name: Prepare Vaultist for upload
run: |
lipo -create \
-output target/vaultist \
target/aarch64-apple-darwin/release/vaultist \
target/x86_64-apple-darwin/release/vaultist
lipo -create \
-output target/libvaultist.dylib \
target/aarch64-apple-darwin/release/libvaultist.dylib \
target/x86_64-apple-darwin/release/libvaultist.dylib
lipo -create \
-output target/libvaultist.a \
target/aarch64-apple-darwin/release/libvaultist.a \
target/x86_64-apple-darwin/release/libvaultist.a
strip ./target/vaultist
chmod +x ./target/vaultist
cd ./target
tar -cvf universal-vaultist.osx.tar \
vaultist \
libvaultist.dylib \
libvaultist.a
cd ./x86_64-apple-darwin/release/
strip ./vaultist
chmod +x ./vaultist
tar -cvf x86_64-vaultist.osx.tar \
vaultist \
libvaultist.dylib \
libvaultist.a
cd ../../aarch64-apple-darwin/release/
strip ./vaultist
chmod +x ./vaultist
tar -cvf aarch64-vaultist.osx.tar \
vaultist \
libvaultist.dylib \
libvaultist.a
- name: Upload Vaultist AMD64 build artifacts to GitHub
uses: actions/upload-artifact@v3
with:
name: x86_64-vaultist.osx
path: ./target/x86_64-apple-darwin/release/x86_64-vaultist.osx.tar
if-no-files-found: error
- name: Upload Vaultist ARM64 build artifacts to GitHub
uses: actions/upload-artifact@v3
with:
name: aarch64-vaultist.osx
path: ./target/aarch64-apple-darwin/release/aarch64-vaultist.osx.tar
if-no-files-found: error
- name: Upload Vaultist Universal build artifacts to GitHub
uses: actions/upload-artifact@v3
with:
name: universal-vaultist.osx
path: ./target/universal-vaultist.osx.tar
if-no-files-found: error