Skip to content

Commit

Permalink
ci: linux arm64
Browse files Browse the repository at this point in the history
purocean committed Dec 12, 2022
1 parent ff37833 commit e2c8cb1
Showing 3 changed files with 20 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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'
Binary file added files/linux-arm64-15.4.1-pty.node
Binary file not shown.
12 changes: 10 additions & 2 deletions scripts/download-pandoc.js
Original file line number Diff line number Diff line change
@@ -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 }))

0 comments on commit e2c8cb1

Please sign in to comment.