Skip to content

Commit

Permalink
updating workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Jan 23, 2025
1 parent 2d4d35c commit e2a8807
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,29 @@ jobs:
node-version: 22
cache: 'npm'
cache-dependency-path: package-lock.json


- name: Read package.json
uses: actions/github-script@v7
with:
result-encoding: string
script: |
try {
const fs = require('fs')
const jsonString = fs.readFileSync('package.json')
var json = JSON.parse(jsonString);
core.exportVariable('json_electron_version', json.devDependencies.electron.toString())
} catch(err) {
core.error("Error while reading or parsing package.json")
core.setFailed(err)
}
- name: Cache node-gyp
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~/.cache/node-gyp
key: '${{ runner.os }}'
key: '${{ runner.os }}-${{ env.json_electron_version}}'

- name: Cache node modules
id: cache-nodemodules
Expand Down

0 comments on commit e2a8807

Please sign in to comment.