1515 sudo chown -R circleci:circleci /usr/local/cargo
1616 fi
1717 - restore_cache :
18+ name : Restore Linux Rust Cache
1819 key : cargo-cache-linux-{{ checksum "Cargo.lock" }}-{{ checksum "Cargo.toml" }}
1920
2021 # - run:
3435
3536 - run :
3637 name : Build Binary
37- command : cargo build --release
38+ command : cargo build --release --target=x86_64-unknown-linux-gnu
3839
3940 - save_cache :
41+ name : Save Linux Rust Cache
4042 key : cargo-cache-linux-{{ checksum "Cargo.lock" }}-{{ checksum "Cargo.toml" }}
4143 paths :
4244 - " ~/.cargo/"
@@ -46,25 +48,32 @@ jobs:
4648
4749 - run :
4850 name : " Generate hash file"
49- command : " cd target/release && sha256sum library-loader > library-loader.checksum "
51+ command : " cd target/x86_64-unknown-linux-gnu/ release && sha256sum library-loader > library-loader.sha256 "
5052
5153 - run :
5254 name : " Verify hash"
53- command : " cd target/release && sha256sum -c library-loader.checksum "
55+ command : " cd target/x86_64-unknown-linux-gnu/ release && sha256sum -c library-loader.sha256 "
5456
5557 - run :
5658 name : " Show hash"
57- command : " cd target/release && cat library-loader.checksum "
59+ command : " cd target/x86_64-unknown-linux-gnu/ release && cat library-loader.sha256 "
5860
59- - store_artifacts :
60- name : Store Build
61- path : " ./target/release/library-loader"
62- destination : " /linux/library-loader"
61+ - save_cache :
62+ name : Save Linux Build Cache
63+ key : ll-linux-dist-{{ .Environment.CIRCLE_SHA1 }}
64+ paths :
65+ - " ./target/x86_64-unknown-linux-gnu/release/library-loader"
66+ - " ./target/x86_64-unknown-linux-gnu/release/library-loader.sha256"
6367
64- - store_artifacts :
65- name : Store Build Checksum
66- path : " ./target/release/library-loader.checksum"
67- destination : " /linux/library-loader.checksum"
68+ # - store_artifacts:
69+ # name: Store Build
70+ # path: "./target/x86_64-unknown-linux-gnu/release/library-loader"
71+ # destination: "/linux/library-loader"
72+
73+ # - store_artifacts:
74+ # name: Store Build Checksum
75+ # path: "./target/x86_64-unknown-linux-gnu/release/library-loader.sha256"
76+ # destination: "/linux/library-loader.sha256"
6877
6978 windows :
7079 docker :
8089 sudo chown -R circleci:circleci /usr/local/cargo
8190 fi
8291 - restore_cache :
92+ name : Restore Windows Rust Cache
8393 key : cargo-cache-windows-{{ checksum "Cargo.lock" }}-{{ checksum "Cargo.toml" }}
8494
8595 - run :
@@ -121,39 +131,87 @@ jobs:
121131 command : cargo build --release --target=x86_64-pc-windows-gnu
122132
123133 - save_cache :
134+ name : Save Windows Rust Cache
124135 key : cargo-cache-windows-{{ checksum "Cargo.lock" }}-{{ checksum "Cargo.toml" }}
125136 paths :
126137 - " ~/.cargo/"
127138 - " ~/.rustup/"
128- - " ./target"
139+ - " ./target/x86_64-pc-windows-gnu "
129140 - " /usr/local/cargo"
130141
131142 - run :
132143 name : " Generate hash file"
133- command : " cd target/x86_64-pc-windows-gnu/release && sha256sum library-loader.exe > library-loader.exe.checksum "
144+ command : " cd target/x86_64-pc-windows-gnu/release && sha256sum library-loader.exe > library-loader.exe.sha256 "
134145
135146 - run :
136147 name : " Verify hash"
137- command : " cd target/x86_64-pc-windows-gnu/release && sha256sum -c library-loader.exe.checksum "
148+ command : " cd target/x86_64-pc-windows-gnu/release && sha256sum -c library-loader.exe.sha256 "
138149
139150 - run :
140151 name : " Show hash"
141- command : " cd target/x86_64-pc-windows-gnu/release && cat library-loader.exe.checksum"
152+ command : " cd target/x86_64-pc-windows-gnu/release && cat library-loader.exe.sha256"
153+
154+ - save_cache :
155+ name : Save Windows Build
156+ key : ll-windows-dist-{{ .Environment.CIRCLE_SHA1 }}
157+ paths :
158+ - " ./target/x86_64-pc-windows-gnu/release/library-loader.exe"
159+ - " ./target/x86_64-pc-windows-gnu/release/library-loader.exe.sha256"
142160
143- - store_artifacts :
144- name : Store Build
145- path : " ./target/x86_64-pc-windows-gnu/release/library-loader.exe"
146- destination : " /windows/library-loader.exe"
161+ # - store_artifacts:
162+ # name: Store Build
163+ # path: "./target/x86_64-pc-windows-gnu/release/library-loader.exe"
164+ # destination: "/windows/library-loader.exe"
165+
166+ # - store_artifacts:
167+ # name: Store Build Checksum
168+ # path: "./target/x86_64-pc-windows-gnu/release/library-loader.exe.sha256"
169+ # destination: "/windows/library-loader.exe.sha256"
170+
171+ deploy :
172+ docker :
173+ - image : circleci/node:latest
174+
175+ steps :
176+ - checkout
147177
148- - store_artifacts :
149- name : Store Build Checksum
150- path : " ./target/x86_64-pc-windows-gnu/release/library-loader.exe.checksum"
151- destination : " /windows/library-loader.exe.checksum"
178+ - restore_cache :
179+ name : Restore Deploy Node Cache
180+ key : deploy-cache-{{ checksum ".circleci/deploy/package.json" }}-{{ checksum ".circleci/deploy/package-lock.json" }}
181+
182+ - run :
183+ name : Install dependencies
184+ command : cd .circleci/deploy && npm install
185+
186+ - save_cache :
187+ name : Save Node Cache
188+ key : deploy-cache-{{ checksum ".circleci/deploy/package.json" }}-{{ checksum ".circleci/deploy/package-lock.json" }}
189+ paths :
190+ - " ./.circleci/deploy/node_modules"
191+
192+ - restore_cache :
193+ name : Restore Linux Build
194+ key : ll-linux-dist-{{ .Environment.CIRCLE_SHA1 }}
195+
196+ - restore_cache :
197+ name : Restore Windows Build
198+ key : ll-windows-dist-{{ .Environment.CIRCLE_SHA1 }}
199+
200+ - run :
201+ name : Deploy
202+ command : node .circleci/deploy/deploy.js
152203
153204workflows :
154205 version : 2
155206 build :
156207 jobs :
157208 - linux
158209 - windows
159- # - macos
210+ - deploy :
211+ type : approval
212+ requires :
213+ - linux
214+ - windows
215+ filters :
216+ branches :
217+ only : master
0 commit comments