diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d8fd8e0..96c59a0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: yarn run electron-builder --${{ matrix.platform }} --x64 -p never | sed 's/identityName=.*$//' find ./out -regex '.*app.asar.unpacked/node_modules/node-pty/build/Release/pty.node$' | grep pty.node mv out/latest-mac.yml out/latest-mac-x64.yml - cp ./files/*pty.node ./node_modules/node-pty/build/Release/pty.node + cp ./files/m1*pty.node ./node_modules/node-pty/build/Release/pty.node sed -i '' 's/out\/mac\/Yank Note.app/out\/mac-arm64\/Yank Note.app/' electron-builder.json yarn run electron-builder --${{ matrix.platform }} --arm64 -p never | sed 's/identityName=.*$//' mv out/latest-mac.yml out/latest-mac-arm64.yml @@ -80,6 +80,15 @@ jobs: run: | yarn run electron-builder --${{ matrix.platform }} -p never | sed 's/identityName=.*$//' find ./out -regex '.*app.asar.unpacked/node_modules/node-pty/build/Release/pty.node$' | grep pty.node + mv out/latest-linux.yml out/latest-linux-x64.yml + + - name: Electron-Linux-Arm64 + if: matrix.platform == 'linux' && matrix.os != 'ubuntu-18.04' + run: | + node scripts/download-pandoc.js --force-arm64 + cp ./files/linux-arm64*pty.node ./node_modules/node-pty/build/Release/pty.node + yarn run electron-builder --${{ matrix.platform }} --arm64 -p never | sed 's/identityName=.*$//' + mv out/latest-linux.yml out/latest-linux-arm64.yml - name: Rename Artifact for Ubuntu-18.04 if: matrix.os == 'ubuntu-18.04' diff --git a/files/linux-arm64-15.4.1-pty.node b/files/linux-arm64-15.4.1-pty.node new file mode 100755 index 00000000..9a13c293 Binary files /dev/null and b/files/linux-arm64-15.4.1-pty.node differ diff --git a/scripts/download-pandoc.js b/scripts/download-pandoc.js index 32d6edfe..f9ba1608 100644 --- a/scripts/download-pandoc.js +++ b/scripts/download-pandoc.js @@ -3,8 +3,12 @@ const fs = require('fs') const path = require('path') const request = require('request') +const forceArm64 = process.argv.includes('--force-arm64') + const filename = os.platform() + '-' + 'pandoc-2.14.2' + (os.platform() === 'win32' ? '.exe' : '') -const downloadUrl = 'https://github.com/purocean/yn/releases/download/v1.1/' + filename +const downloadUrl = 'https://github.com/purocean/yn/releases/download/v1.1/' + (forceArm64 ? (filename + '-arm64') : filename) + +console.info('Download pandoc', downloadUrl, filename) const dir = path.join(__dirname, '../bin') if (!fs.existsSync(dir)) { @@ -13,7 +17,11 @@ if (!fs.existsSync(dir)) { const filePath = path.join(dir, filename) if (fs.existsSync(filePath)) { - console.warn('Pandoc exists. Skip download.', filePath) + if (forceArm64) { + fs.unlinkSync(filePath) + } else { + console.warn('Pandoc exists. Skip download.', filePath) + } } else { console.info('Download pandoc', downloadUrl, filename, filePath) request(downloadUrl).pipe(fs.createWriteStream(filePath, { mode: 0o755 }))