Skip to content

Commit

Permalink
build: add circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Sep 22, 2022
1 parent 491a7a3 commit b9cf213
Show file tree
Hide file tree
Showing 5 changed files with 3,324 additions and 101 deletions.
76 changes: 76 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
step-restore-cache: &step-restore-cache
restore_cache:
keys:
- v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
- v1-dependencies-{{ arch }}

commands:
test:
steps:
- run: git config --global core.autocrlf input
- checkout
- *step-restore-cache
- run: npx yarn --frozen-lockfile
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
- run: npx yarn test

version: 2.1
orbs:
win: circleci/[email protected]
jobs:
test-linux-16:
docker:
- image: cimg/node:16.17
steps:
- test
test-mac:
macos:
xcode: "13.0.0"
steps:
- test
# test-windows:
# executor:
# name: win/default
# shell: bash.exe
# steps:
# - run: choco install wget -y
# - run:
# command: wget https://nodejs.org/dist/v16.17.0/node-v16.17.0-x86.msi -P C:\Users\circleci\Downloads\
# shell: cmd.exe
# - run: MsiExec.exe /i C:\Users\circleci\Downloads\node-v16.17.0-x86.msi /qn
# - run:
# command: |
# Start-Process powershell -verb runAs -Args "-start GeneralProfile"
# nvm install 16.17.0
# nvm use 16.17.0
# - test

release:
docker:
- image: cimg/node:14.20
steps:
- checkout
- *step-restore-cache
- run: npx yarn
- run: npx [email protected]
workflows:
version: 2
test_and_release:
# Run the test jobs first, then the release only when all the test jobs are successful
jobs:
- test-linux-16
- test-mac
# - test-windows
- release:
requires:
- test-linux-16
- test-mac
# - test-windows
filters:
branches:
only:
- main

10 changes: 10 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@continuous-auth/semantic-release-npm",
"@semantic-release/github"
],
"branches": [ "main" ]
}

18 changes: 8 additions & 10 deletions jest.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ import { supportedPlatforms } from './test/helpers';
module.exports = async () => {
console.log('\nDownloading all Electron binaries required for testing...');

await Promise.all(
supportedPlatforms.map(async ([platform, arch]) => {
return downloadArtifact({
version: '20.0.0',
platform,
arch,
artifactName: 'electron',
});
}),
);
for (const [platform, arch] of supportedPlatforms) {
await downloadArtifact({
version: '20.0.0',
platform,
arch,
artifactName: 'electron',
});
}

console.log('Done...');
};
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "@electron/fuses",
"version": "1.5.0",
"version": "0.0.0-development",
"main": "dist/index.js",
"license": "MIT",
"bin": {
"electron-fuses": "dist/bin.js"
},
"scripts": {
"build": "tsc"
"build": "tsc",
"test": "jest",
"prepublishOnly": "tsc"
},
"devDependencies": {
"@continuous-auth/semantic-release-npm": "^2.0.0",
"@electron/get": "^2.0.1",
"@electron/universal": "^1.3.0",
"@types/fs-extra": "^9.0.1",
Expand Down
Loading

0 comments on commit b9cf213

Please sign in to comment.