-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile.toml
More file actions
181 lines (150 loc) · 4.84 KB
/
Makefile.toml
File metadata and controls
181 lines (150 loc) · 4.84 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# Load from the env file
env_files = [{ path = ".env" }]
# Build Windows and Linux in parallel (Cross compiling with cargo cross)
[tasks.build-all]
run_task = { name = ["build-windows", "build-linux"], parallel = true }
# Build a Linux build
[tasks.build-linux]
run_task = [
# Windows host taks
{ name = [
"build-linux-windows",
"copy-build-linux-windows",
], condition = { platforms = [
"windows",
] } },
# Linux host tasks
{ name = [
"build-linux-linux",
"copy-build-linux-linux",
], condition = { platforms = [
"linux",
] } },
]
# Build a Windows Build
[tasks.build-windows]
run_task = [
# Windows host tasks (Both UI builds must run sequentual as they use the same output path)
{ name = [
"build-windows-windows",
"copy-build-windows-windows",
"sign-windows",
"build-windows-native-windows",
"copy-build-windows-native-windows",
"sign-windows-native",
], condition = { platforms = [
"windows",
] } },
# Linux host tasks
{ name = [
"build-windows-linux",
"copy-build-windows-linux",
"build-windows-native-linux",
"copy-build-windows-native-linux",
], condition = { platforms = [
"linux",
] } },
]
# Signs the windows executable
[tasks.sign-windows]
command = "${SIGNTOOL_PATH}"
args = [
"sign",
"/fd",
"SHA256",
"/f",
"${SIGN_FILE}",
"/p",
"${SIGN_PASSWORD}",
".release/binaries/pocket-relay-client.exe",
]
[tasks.sign-windows.condition]
env_set = ["SIGN_FILE", "SIGN_PASSWORD", "SIGNTOOL_PATH"]
platforms = ["windows"]
files_exist = ["${SIGNTOOL_PATH}"]
# Signs the windows executable (Native UI)
[tasks.sign-windows-native]
command = "${SIGNTOOL_PATH}"
args = [
"sign",
"/fd",
"SHA256",
"/f",
"${SIGN_FILE}",
"/p",
"${SIGN_PASSWORD}",
".release/binaries/pocket-relay-client-native.exe",
]
[tasks.sign-windows-native.condition]
env_set = ["SIGN_FILE", "SIGN_PASSWORD", "SIGNTOOL_PATH"]
platforms = ["windows"]
files_exist = ["${SIGNTOOL_PATH}"]
# ---- Building from a windows host ----
# Build a Windows binary from a Windows host
[tasks.build-windows-windows]
command = "cargo"
args = ["build", "--release"]
# Build a Windows binary (Native UI) from a Windows host
[tasks.build-windows-native-windows]
command = "cargo"
args = ["build", "--release", "--no-default-features", "--features", "native"]
# Build the linux version (Requires cross be installed)
[tasks.build-linux-windows]
command = "cross"
args = ["build", "--target", "x86_64-unknown-linux-gnu", "--release"]
# Copy the linux build to the releases folder
[tasks.copy-build-linux-windows]
script_runner = "@shell"
script = "cp target/x86_64-unknown-linux-gnu/release/pocket-relay-client .release/binaries/pocket-relay-client"
dependencies = ["create-release-dir"]
# Copy the Windows build to the releases folder
[tasks.copy-build-windows-windows]
script_runner = "@shell"
script = "cp target/release/pocket-relay-client.exe .release/binaries/pocket-relay-client.exe"
dependencies = ["create-release-dir"]
# Copy the Windows build to the releases folder
[tasks.copy-build-windows-native-windows]
script_runner = "@shell"
script = "cp target/release/pocket-relay-client.exe .release/binaries/pocket-relay-client-native.exe"
dependencies = ["create-release-dir"]
# ---- Building from a linux host ----
# Build a Windows binary from a linux host
[tasks.build-windows-linux]
command = "cargo"
args = ["build", "--target", "x86_64-pc-windows-gnu", "--release"]
# Build a Windows binary (Native UI) from a linux host
[tasks.build-windows-native-linux]
command = "cargo"
args = [
"build",
"--target",
"x86_64-pc-windows-gnu",
"--release",
"--no-default-features",
"--features",
"native",
]
# Build the linux version (Requires cross be installed)
[tasks.build-linux-linux]
command = "cross"
args = ["build", "--release"]
# Copy the linux build to the releases folder
[tasks.copy-build-linux-linux]
script_runner = "@shell"
script = "cp target/release/pocket-relay-client .release/binaries/pocket-relay-client-linux"
dependencies = ["create-release-dir"]
# Copy the Windows build to the releases folder
[tasks.copy-build-windows-linux]
script_runner = "@shell"
script = "cp target/x86_64-pc-windows-gnu/release/pocket-relay-client.exe .release/binaries/pocket-relay-client.exe"
dependencies = ["create-release-dir"]
# Copy the Windows build to the releases folder
[tasks.copy-build-windows-native-linux]
script_runner = "@shell"
script = "cp target/x86_64-pc-windows-gnu/release/pocket-relay-client.exe .release/binaries/pocket-relay-client-native.exe"
dependencies = ["create-release-dir"]
# Create releases directory
[tasks.create-release-dir]
condition = { files_not_exist = [".release/binaries"] }
script_runner = "@shell"
script = "mkdir -p .release/binaries"