diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e91eb1b..4ef4f62 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: steps: # step1: check out repository - name: Check out git repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # step2: install node env - name: Install Node.js @@ -57,7 +57,9 @@ jobs: if: matrix.os == 'windows-2019' run: | npm run package:win64 - npm run zip:win64 + npm run 7z:win64 + npm run package:winarm + npm run 7z:winarm env: GH_TOKEN: ${{ secrets.SECRET_TOKEN }} @@ -75,12 +77,6 @@ jobs: if: matrix.os == 'macos-14' run: echo "VERSION_TAG=$(git describe --tags)" >> $GITHUB_ENV - - name: Get the version tag win - if: matrix.os == 'windows-2019' - run: | - $versionTag = git describe --tags - echo "VERSION_TAG=$versionTag" >> $GITHUB_ENV - - name: Rename files in OutApp/packages if: matrix.os == 'macos-14' run: | @@ -96,7 +92,7 @@ jobs: - name: Rename files in OutApp/packages win if: matrix.os == 'windows-2019' run: | - $versionTag = "${{ env.VERSION_TAG }}" + $versionTag = git describe --tags Get-ChildItem OutApp/packages -File | ForEach-Object { $baseName = $_.BaseName $extension = $_.Extension @@ -106,14 +102,14 @@ jobs: # step6: upload artifacts - name: upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }} path: OutApp/packages # step7: create release - name: release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: files: "OutApp/packages/**" diff --git a/builddmgjsonarm.js b/builddmgjsonarm.js index 5cef0cf..34d0bef 100644 --- a/builddmgjsonarm.js +++ b/builddmgjsonarm.js @@ -15,7 +15,7 @@ if (!fs.existsSync(path2)) { // 配置对象 let config = { title: 'SysMocap-macOS-arm64', - format: 'UDZO', + format: 'ULMO', contents: [ { x: 448, y: 344, type: 'link', path: '/Applications' }, { diff --git a/builddmgjsonx86.js b/builddmgjsonx86.js index ad90b73..ea75f27 100644 --- a/builddmgjsonx86.js +++ b/builddmgjsonx86.js @@ -15,7 +15,7 @@ if (!fs.existsSync(path2)) { // 配置对象 let config = { title: 'SysMocap-macOS-x64', - format: 'UDZO', + format: 'ULMO', contents: [ { x: 448, y: 344, type: 'link', path: '/Applications' }, { diff --git a/icons/dmgbackground.png b/icons/dmgbackground.png new file mode 100644 index 0000000..6b918a4 Binary files /dev/null and b/icons/dmgbackground.png differ diff --git a/package.json b/package.json index 7db0d63..ecbb2c8 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,12 @@ "package:mac64": "npx @electron/packager ./ SysMocap --icon=icons/sysmocap.icns --platform=darwin --arch=x64 --out ./OutApp --overwrite --usage-description.Camera='该程序需要摄像头权限' --electronVersion 31.1.0 --asar", "package:macarm": "npx @electron/packager ./ SysMocap --icon=icons/sysmocap.icns --platform=darwin --arch=arm64 --out ./OutApp --overwrite --usage-description.Camera='该程序需要摄像头权限' --electronVersion 31.1.0 --asar", "package:win64": "npx @electron/packager ./ SysMocap --icon=icons/sysmocap.ico --platform=win32 --arch=x64 --out ./OutApp --overwrite --electronVersion 31.1.0 --asar", - "zip:win64": "electron-installer-zip ./OutApp/SysMocap-win32-x64/ ./OutApp/packages/SysMocap-Windows-x64.zip --overwrite", - "zip:mac64": "electron-installer-zip ./OutApp/SysMocap-darwin-x64/ ./OutApp/packages/SysMocap-macOS-x64.zip --overwrite", + "package:winarm": "npx @electron/packager ./ SysMocap --icon=icons/sysmocap.ico --platform=win32 --arch=arm64 --out ./OutApp --overwrite --electronVersion 31.1.0 --asar", + "7z:win64": "7z a -t7z -mx=9 -y ./OutApp/packages/SysMocap-Windows-x64.7z ./OutApp/SysMocap-win32-x64/", + "7z:winarm": "7z a -t7z -mx=9 -y ./OutApp/packages/SysMocap-Windows-arm64.7z ./OutApp/SysMocap-win32-arm64/", + "dmgtool": "npm install -g appdmg", "dmg": "node builddmgjsonx86.js && appdmg ./dmgcfg.json ./OutApp/packages/SysMocap-macOS-x64.dmg && rm ./dmgcfg.json", - "dmgarm": "node builddmgjsonarm.js && appdmg ./dmgcfg.json ./OutApp/packages/SysMocap-macOS-arm.dmg && rm ./dmgcfg.json" + "dmgarm": "node builddmgjsonarm.js && appdmg ./dmgcfg.json ./OutApp/packages/SysMocap-macOS-arm64.dmg && rm ./dmgcfg.json" }, "author": "xianfei", "license": "ISC", @@ -36,13 +38,9 @@ "three": "^0.164.1", "vue": "^2.7.14" }, - "overrides": { - "nan": "github:jkleinsc/nan#remove_accessor_signature" - }, "devDependencies": { "electron": "^31.1.0", "electron-installer-dmg": "^5.0.1", - "electron-installer-zip": "^0.1.2", "@electron/packager": "^18.3.3" } }