Skip to content

Commit b9cf213

Browse files
build: add circleci config
1 parent 491a7a3 commit b9cf213

File tree

5 files changed

+3324
-101
lines changed

5 files changed

+3324
-101
lines changed

.circleci/config.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
step-restore-cache: &step-restore-cache
2+
restore_cache:
3+
keys:
4+
- v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
5+
- v1-dependencies-{{ arch }}
6+
7+
commands:
8+
test:
9+
steps:
10+
- run: git config --global core.autocrlf input
11+
- checkout
12+
- *step-restore-cache
13+
- run: npx yarn --frozen-lockfile
14+
- save_cache:
15+
paths:
16+
- node_modules
17+
key: v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
18+
- run: npx yarn test
19+
20+
version: 2.1
21+
orbs:
22+
win: circleci/[email protected]
23+
jobs:
24+
test-linux-16:
25+
docker:
26+
- image: cimg/node:16.17
27+
steps:
28+
- test
29+
test-mac:
30+
macos:
31+
xcode: "13.0.0"
32+
steps:
33+
- test
34+
# test-windows:
35+
# executor:
36+
# name: win/default
37+
# shell: bash.exe
38+
# steps:
39+
# - run: choco install wget -y
40+
# - run:
41+
# command: wget https://nodejs.org/dist/v16.17.0/node-v16.17.0-x86.msi -P C:\Users\circleci\Downloads\
42+
# shell: cmd.exe
43+
# - run: MsiExec.exe /i C:\Users\circleci\Downloads\node-v16.17.0-x86.msi /qn
44+
# - run:
45+
# command: |
46+
# Start-Process powershell -verb runAs -Args "-start GeneralProfile"
47+
# nvm install 16.17.0
48+
# nvm use 16.17.0
49+
# - test
50+
51+
release:
52+
docker:
53+
- image: cimg/node:14.20
54+
steps:
55+
- checkout
56+
- *step-restore-cache
57+
- run: npx yarn
58+
- run: npx [email protected]
59+
workflows:
60+
version: 2
61+
test_and_release:
62+
# Run the test jobs first, then the release only when all the test jobs are successful
63+
jobs:
64+
- test-linux-16
65+
- test-mac
66+
# - test-windows
67+
- release:
68+
requires:
69+
- test-linux-16
70+
- test-mac
71+
# - test-windows
72+
filters:
73+
branches:
74+
only:
75+
- main
76+

.releaserc.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@continuous-auth/semantic-release-npm",
6+
"@semantic-release/github"
7+
],
8+
"branches": [ "main" ]
9+
}
10+

jest.global.ts

+8-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ import { supportedPlatforms } from './test/helpers';
44
module.exports = async () => {
55
console.log('\nDownloading all Electron binaries required for testing...');
66

7-
await Promise.all(
8-
supportedPlatforms.map(async ([platform, arch]) => {
9-
return downloadArtifact({
10-
version: '20.0.0',
11-
platform,
12-
arch,
13-
artifactName: 'electron',
14-
});
15-
}),
16-
);
7+
for (const [platform, arch] of supportedPlatforms) {
8+
await downloadArtifact({
9+
version: '20.0.0',
10+
platform,
11+
arch,
12+
artifactName: 'electron',
13+
});
14+
}
1715

1816
console.log('Done...');
1917
};

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
22
"name": "@electron/fuses",
3-
"version": "1.5.0",
3+
"version": "0.0.0-development",
44
"main": "dist/index.js",
55
"license": "MIT",
66
"bin": {
77
"electron-fuses": "dist/bin.js"
88
},
99
"scripts": {
10-
"build": "tsc"
10+
"build": "tsc",
11+
"test": "jest",
12+
"prepublishOnly": "tsc"
1113
},
1214
"devDependencies": {
15+
"@continuous-auth/semantic-release-npm": "^2.0.0",
1316
"@electron/get": "^2.0.1",
1417
"@electron/universal": "^1.3.0",
1518
"@types/fs-extra": "^9.0.1",

0 commit comments

Comments
 (0)