mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-02-02 02:16:46 +01:00
Generate thirdparty list
This commit is contained in:
parent
2b94fa66d6
commit
350246bf76
34
.github/workflows/thirdparty.yml
vendored
Normal file
34
.github/workflows/thirdparty.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
name: Thirdparty
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '54 10 * * *'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install packages
|
||||
run: |
|
||||
yarn install
|
||||
npm install -g license-checker
|
||||
- name: Check
|
||||
run: |
|
||||
yarn run thirdparty
|
||||
- uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
commit-message: "[Auto update] Thirdparty libraries list"
|
||||
branch: auto-update/thirdparty
|
||||
base: master
|
||||
delete-branch: true
|
||||
title: "[Auto update] Thirdparty libraries list"
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -11,4 +11,5 @@ thumbs.db
|
||||
packages/*
|
||||
!.gitkeep
|
||||
*.db
|
||||
*.provisionprofile
|
||||
*.provisionprofile
|
||||
/thirdparty.json
|
@ -35,7 +35,8 @@
|
||||
"pack:renderer": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.renderer.config.js",
|
||||
"typecheck": "tsc -p . --noEmit",
|
||||
"spec": "NODE_ENV=test jest -u --maxWorkers=3",
|
||||
"postinstall": "electron-builder install-app-deps"
|
||||
"postinstall": "electron-builder install-app-deps",
|
||||
"thirdparty": "license-checker --production --json > thirdparty.json && node scripts/thirdparty.js"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
|
27
scripts/thirdparty.js
Normal file
27
scripts/thirdparty.js
Normal file
@ -0,0 +1,27 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
|
||||
const npmPath = path.join(__dirname, '../thirdparty.json')
|
||||
const outPath = path.join(__dirname, '../', 'src', 'config', 'thirdparty.json')
|
||||
|
||||
const npmData = JSON.parse(fs.readFileSync(npmPath))
|
||||
|
||||
let npm = Object.keys(npmData).map(k => {
|
||||
let r = {
|
||||
package_name: k,
|
||||
license: npmData[k].licenses
|
||||
}
|
||||
if (npmData[k].publisher) {
|
||||
r = Object.assign(r, {
|
||||
publisher: npmData[k].publisher
|
||||
})
|
||||
}
|
||||
if (npmData[k].repository) {
|
||||
r = Object.assign(r, {
|
||||
repository: npmData[k].repository
|
||||
})
|
||||
}
|
||||
return r
|
||||
})
|
||||
|
||||
fs.writeFileSync(outPath, JSON.stringify(npm))
|
1
src/config/thirdparty.json
Normal file
1
src/config/thirdparty.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user