Skip to content

Commit 64210b8

Browse files
build: update CI file to lock actions and pass CI (#196)
1 parent e2ec877 commit 64210b8

10 files changed

+4649
-43
lines changed

.github/workflows/ci.yml

+14-24
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,35 @@ on:
77
tags:
88
- v[0-9]+.[0-9]+.[0-9]+*
99
pull_request:
10+
workflow_call:
11+
12+
permissions:
13+
contents: read
1014

1115
jobs:
1216
build:
1317
runs-on: ${{ matrix.os }}
1418
strategy:
19+
fail-fast: false
1520
matrix:
16-
os: [windows-latest, macOS-latest, ubuntu-latest]
17-
node-version: [10.x, 12.x]
21+
os: [windows-latest, macos-13, ubuntu-latest]
22+
node-version: [14.x, 16.x, 18.x, 20.x]
1823

1924
steps:
2025
- name: Fix git checkout line endings
2126
run: git config --global core.autocrlf input
22-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2328
- name: Setup Node.js
24-
uses: actions/setup-node@v1
29+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
2530
with:
2631
node-version: ${{ matrix.node-version }}
27-
- name: Cache node_modules
28-
uses: actions/cache@v1
29-
with:
30-
path: node_modules
31-
key: ${{ runner.OS }}-build-${{ hashFiles('**/package.json') }}
32-
restore-keys: |
33-
${{ runner.OS }}-build-${{ env.cache-name }}-
34-
${{ runner.OS }}-build-
35-
${{ runner.OS }}-
32+
cache: yarn
3633
- name: Install
3734
run: |
38-
npm install --engine-strict
39-
npm update
35+
yarn install --frozen-lockfile --ignore-engines
4036
- name: Lint
41-
run: npm run lint
37+
run: yarn lint
4238
- name: TypeScript definition linting
43-
run: npm run tsd
39+
run: yarn tsd
4440
- name: Test
45-
run: npm run coverage
46-
- name: Codecov
47-
run: npm run codecov
48-
env:
49-
CI_OS: ${{ matrix.os }}
50-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
51-
NODE_VERSION: ${{ matrix.node-version }}
41+
run: yarn coverage

.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
uses: ./.github/workflows/ci.yml
11+
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
needs: test
16+
environment: npm
17+
permissions:
18+
id-token: write # for CFA and npm provenance
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
persist-credentials: false
24+
- name: Setup Node.js
25+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
26+
with:
27+
node-version: 20.x
28+
cache: 'yarn'
29+
- name: Install
30+
run: yarn install --frozen-lockfile
31+
- uses: continuousauth/action@4e8a2573eeb706f6d7300d6a9f3ca6322740b72d # v1.0.5
32+
with:
33+
project-id: ${{ secrets.CFA_PROJECT_ID }}
34+
secret: ${{ secrets.CFA_SECRET }}
35+
npm-token: ${{ secrets.NPM_TOKEN }}

.github/workflows/semantic.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Check Semantic Commit"
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
main:
15+
permissions:
16+
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
17+
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
18+
name: Validate PR Title
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: semantic-pull-request
22+
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
validateSingleCommit: false

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.nyc_output
22
node_modules
33
package-lock.json
4-
yarn.lock

.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+

package.json

+21-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "electron-installer-common",
3-
"version": "0.10.4",
3+
"version": "0.0.0-development",
44
"description": "Common functionality for creating distributable Electron apps",
55
"author": "Mark Lee",
66
"license": "Apache-2.0",
@@ -26,34 +26,35 @@
2626
"src"
2727
],
2828
"devDependencies": {
29-
"@typescript-eslint/eslint-plugin": "^4.8.0",
30-
"@typescript-eslint/parser": "^4.8.0",
31-
"ava": "^3.0.0",
29+
"@typescript-eslint/eslint-plugin": "^5.62.0",
30+
"@typescript-eslint/parser": "^5.62.0",
31+
"ava": "^4.3.3",
3232
"codecov": "^3.5.0",
33-
"eslint": "^7.12.1",
34-
"eslint-config-standard": "^16.0.0",
33+
"eslint": "^8.57.1",
34+
"eslint-config-standard": "^17.0.0",
3535
"eslint-plugin-ava": "^12.0.0",
36-
"eslint-plugin-import": "^2.22.1",
37-
"eslint-plugin-node": "^11.0.0",
38-
"eslint-plugin-promise": "^5.1.0",
39-
"nyc": "^15.0.0",
36+
"eslint-plugin-import": "^2.31.0",
37+
"eslint-plugin-n": "^15.7.0",
38+
"eslint-plugin-node": "^11.1.0",
39+
"eslint-plugin-promise": "^6.1.0",
40+
"nyc": "^15.1.0",
4041
"sinon": "^11.1.0",
4142
"tsd": "^0.16.0",
4243
"typescript": "^4.0.2"
4344
},
4445
"dependencies": {
45-
"@malept/cross-spawn-promise": "^1.0.0",
4646
"@electron/asar": "^3.2.5",
47+
"@malept/cross-spawn-promise": "^2.0.0",
4748
"debug": "^4.1.1",
48-
"fs-extra": "^9.0.0",
49-
"glob": "^7.1.4",
49+
"fs-extra": "^11.2.0",
50+
"glob": "^8.1.0",
5051
"lodash": "^4.17.15",
5152
"parse-author": "^2.0.0",
5253
"semver": "^7.1.1",
5354
"tmp-promise": "^3.0.2"
5455
},
5556
"engines": {
56-
"node": ">= 10.0.0"
57+
"node": ">= 14.14.0"
5758
},
5859
"eslintConfig": {
5960
"extends": [
@@ -64,7 +65,12 @@
6465
"plugin:node/recommended",
6566
"plugin:promise/recommended",
6667
"standard"
67-
]
68+
],
69+
"rules": {
70+
"node/no-missing-require": ["error", {
71+
"allowModules": ["ava"]
72+
}]
73+
}
6874
},
6975
"funding": {
7076
"url": "https://github.com/electron-userland/electron-installer-common?sponsor=1"

src/error.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function errorMessage (message, err) {
55
}
66

77
module.exports = {
8-
errorMessage: errorMessage,
8+
errorMessage,
99
/**
1010
* Prepends the error message with the given `message`.
1111
*

src/installer.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ class ElectronInstaller {
227227
debug('Moving package to destination')
228228

229229
return error.wrapError('moving package files', async () => {
230-
const files = await glob(this.packagePattern)
230+
const files = await glob(this.packagePattern, {
231+
windowsPathsNoEscape: true
232+
})
231233
this.options.packagePaths = await Promise.all(files.map(async file => {
232234
const renameTemplate = this.options.rename(this.options.dest, path.basename(file))
233235
const dest = _.template(renameTemplate)(this.options)

test/installer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ test('movePackage', t => {
180180
const rename = (dest, src) => {
181181
return path.join(dest, 'test_<%= name %>.pkg')
182182
}
183-
const installer = new ElectronInstaller({ name: 'foo', dest: destDir, rename: rename })
183+
const installer = new ElectronInstaller({ name: 'foo', dest: destDir, rename })
184184
installer.generateOptions()
185185
installer.packagePattern = path.join(dir.path, '*.pkg')
186186
await fs.ensureDir(destDir)

0 commit comments

Comments
 (0)