Skip to content

Commit

Permalink
add support for windows-arm
Browse files Browse the repository at this point in the history
  • Loading branch information
xianfei committed Jul 4, 2024
1 parent 836fa1c commit f90e98d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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/**"
Expand Down
2 changes: 1 addition & 1 deletion builddmgjsonarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
{
Expand Down
2 changes: 1 addition & 1 deletion builddmgjsonx86.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
{
Expand Down
Binary file added icons/dmgbackground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}

0 comments on commit f90e98d

Please sign in to comment.