Skip to content

Commit

Permalink
add build support for linux arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
KaMeHb-UA authored and andelf committed Apr 2, 2024
1 parent 5366cd5 commit 87dbf5c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 8 deletions.
82 changes: 74 additions & 8 deletions .github/workflows/build-desktop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
DEBUG: "pw:api"
RELEASE: true # skip dev only test

build-linux:
build-linux-x64:
runs-on: ubuntu-20.04
needs: [ compile-cljs ]
steps:
Expand Down Expand Up @@ -265,7 +265,61 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: logseq-linux-builds
name: logseq-linux-x64-builds
path: builds

build-linux-arm64:
runs-on: ubuntu-20.04
needs: [ compile-cljs ]
steps:
- name: Download The Static Asset
uses: actions/download-artifact@v3
with:
name: static
path: static

- name: Retrieve tag version
id: ref
run: |
pkgver=$(cat ./static/VERSION)
echo "version=$pkgver" >> $GITHUB_OUTPUT
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Fetch deps
env:
npm_config_arch: arm64
run: |
yarn install --target_arch=arm64 --target_platform=linux
rsapi_version=`node -e 'console.log(require("@logseq/rsapi/package.json").optionalDependencies["@logseq/rsapi-linux-arm64-gnu"])'`
temp_dir=`mktemp -d`
cd "$temp_dir"
echo '{"dependencies": {"@logseq/rsapi-linux-arm64-gnu": "'"$rsapi_version"'"}}' > package.json
yarn install --ignore-platform
cd -
mv "$temp_dir/node_modules/@logseq/rsapi-linux-arm64-gnu" node_modules/@logseq/rsapi-linux-arm64-gnu
rm -rf "$temp_dir" "node_modules/@logseq/rsapi-linux-x64-gnu"
working-directory: ./static

- name: Build/Release Electron App
run: yarn electron:make-linux-arm64
working-directory: ./static

- name: Save artifacts
run: |
mkdir -p builds
# NOTE: save VERSION file to builds directory
cp static/VERSION ./builds/VERSION
# mv static/out/make/*-*.AppImage ./builds/Logseq-linux-arm64-${{ steps.ref.outputs.version }}.AppImage
mv static/out/make/zip/linux/arm64/*-linux-arm64-*.zip ./builds/Logseq-linux-arm64-${{ steps.ref.outputs.version }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: logseq-linux-arm64-builds
path: builds

build-windows:
Expand Down Expand Up @@ -498,7 +552,7 @@ jobs:

nightly-release:
if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly' }}
needs: [ build-macos-x64, build-macos-arm64, build-linux, build-windows, build-android, e2e-test ]
needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows, build-android, e2e-test ]
runs-on: ubuntu-20.04
steps:
- name: Download MacOS x64 Artifacts
Expand All @@ -513,10 +567,16 @@ jobs:
name: logseq-darwin-arm64-builds
path: ./

- name: Download The Linux Artifacts
- name: Download The Linux x64 Artifacts
uses: actions/download-artifact@v3
with:
name: logseq-linux-builds
name: logseq-linux-x64-builds
path: ./

- name: Download The Linux arm64 Artifacts
uses: actions/download-artifact@v3
with:
name: logseq-linux-arm64-builds
path: ./

- name: Download The Windows Artifact
Expand Down Expand Up @@ -565,7 +625,7 @@ jobs:
release:
# NOTE: For now, we only have beta channel to be released on Github
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }}
needs: [ build-macos-x64, build-macos-arm64, build-linux, build-windows, e2e-test ]
needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows, e2e-test ]
runs-on: ubuntu-20.04
steps:
- name: Download MacOS x64 Artifacts
Expand All @@ -580,10 +640,16 @@ jobs:
name: logseq-darwin-arm64-builds
path: ./

- name: Download The Linux Artifacts
- name: Download The Linux x64 Artifacts
uses: actions/download-artifact@v3
with:
name: logseq-linux-x64-builds
path: ./

- name: Download The Linux arm64 Artifacts
uses: actions/download-artifact@v3
with:
name: logseq-linux-builds
name: logseq-linux-arm64-builds
path: ./

- name: Download The Windows Artifact
Expand Down
1 change: 1 addition & 0 deletions resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"electron:dev": "electron-forge start",
"electron:debug": "electron-forge start --inspect-electron",
"electron:make": "electron-forge make",
"electron:make-linux-arm64": "electron-forge make --platform=linux --arch=arm64",
"electron:make-macos-arm64": "electron-forge make --platform=darwin --arch=arm64",
"electron:publish:github": "electron-forge publish",
"rebuild:all": "electron-rebuild -v 27.1.3 -f",
Expand Down

0 comments on commit 87dbf5c

Please sign in to comment.