Skip to content

Commit 489d52b

Browse files
authored
ci: set up CFA (#41)
1 parent a6df96f commit 489d52b

File tree

5 files changed

+2650
-61
lines changed

5 files changed

+2650
-61
lines changed

.circleci/config.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
steps-test: &steps-test
8+
steps:
9+
- run: git config --global core.autocrlf input
10+
- checkout
11+
- *step-restore-cache
12+
- run: yarn --frozen-lockfile
13+
- save_cache:
14+
paths:
15+
- node_modules
16+
key: v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
17+
- run: yarn lint
18+
- run: yarn test:ci
19+
20+
version: 2.1
21+
orbs:
22+
win: circleci/[email protected]
23+
jobs:
24+
test-linux-14:
25+
docker:
26+
- image: cimg/node:14.20
27+
<<: *steps-test
28+
test-linux-16:
29+
docker:
30+
- image: cimg/node:16.17
31+
<<: *steps-test
32+
test-mac:
33+
macos:
34+
xcode: "13.0.0"
35+
<<: *steps-test
36+
test-windows:
37+
executor:
38+
name: win/vs2019
39+
shell: bash.exe
40+
steps:
41+
- run:
42+
name: Swap node versions
43+
command: |
44+
set +e
45+
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
46+
export NVM_DIR="$HOME/.nvm"
47+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
48+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
49+
nvm install v16
50+
nvm alias default 16.17.1
51+
52+
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
53+
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
54+
<<: *steps-test
55+
56+
release:
57+
docker:
58+
- image: cimg/node:16.17
59+
steps:
60+
- checkout
61+
- *step-restore-cache
62+
- run: yarn
63+
- run: npx [email protected]
64+
workflows:
65+
version: 2
66+
test_and_release:
67+
# Run the test jobs first, then the release only when all the test jobs are successful
68+
jobs:
69+
- test-linux-14
70+
- test-linux-16
71+
- test-mac
72+
- test-windows
73+
- release:
74+
requires:
75+
- test-linux-14
76+
- test-linux-16
77+
- test-mac
78+
- test-windows
79+
filters:
80+
branches:
81+
only:
82+
- main

.github/workflows/ci.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.releaserc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"homepage": "https://github.com/electron/fiddle-core#readme",
44
"author": "Charles Kerr <[email protected]>",
55
"license": "MIT",
6-
"name": "fiddle-core",
7-
"version": "0.0.2",
6+
"name": "@electron/fiddle-core",
7+
"version": "0.0.0-development",
88
"main": "lib/index.js",
99
"bin": {
1010
"fiddle-core": "lib/index.js"
@@ -23,6 +23,7 @@
2323
"lint:prettier": "prettier --check package.json src/**/*.ts",
2424
"lint:prettier:fix": "prettier --write package.json src/**/*.ts",
2525
"make": "run-p build",
26+
"prepublishOnly": "npm run make",
2627
"start": "node lib/index.js",
2728
"test": "jest",
2829
"test:ci": "jest --runInBand --coverage"
@@ -39,6 +40,7 @@
3940
"simple-git": "^2.48.0"
4041
},
4142
"devDependencies": {
43+
"@continuous-auth/semantic-release-npm": "^3.0.0",
4244
"@microsoft/api-extractor": "^7.19.4",
4345
"@types/debug": "^4.1.5",
4446
"@types/fs-extra": "^9.0.13",
@@ -55,6 +57,7 @@
5557
"nock": "^13.2.2",
5658
"npm-run-all": "^4.1.5",
5759
"prettier": "^2.5.1",
60+
"semantic-release": "^19.0.5",
5861
"ts-jest": "^27.1.2",
5962
"typescript": "^4.5.4"
6063
}

0 commit comments

Comments
 (0)