Browse Source

ci: linux-arm64

Junyi Du 3 years ago
parent
commit
01e34313fd
2 changed files with 51 additions and 0 deletions
  1. 50 0
      .github/workflows/build-desktop-release.yml
  2. 1 0
      resources/package.json

+ 50 - 0
.github/workflows/build-desktop-release.yml

@@ -275,6 +275,56 @@ jobs:
           name: logseq-win64-builds
           path: builds
 
+    build-linux-arm64:
+    runs-on: ubuntu-18.04
+    needs: [ compile-cljs ]
+    steps:
+      - name: Download The Static Asset
+        uses: actions/download-artifact@v2
+        with:
+          name: static
+          path: static
+
+      - name: Retrieve tag version
+        id: ref
+        run: |
+          pkgver=$(cat ./static/VERSION)
+          echo ::set-output name=version::$pkgver
+
+      - name: Install Node.js, NPM and Yarn
+        uses: actions/setup-node@v2
+        with:
+          node-version: ${{ env.NODE_VERSION }}
+
+      # - name: Cache Node Modules
+      #   uses: actions/cache@v2
+      #   with:
+      #     path: |
+      #       **/node_modules
+      #     key: ${{ runner.os }}-node-modules
+
+      - name: Fetch deps and fix dugit arch for arm64
+        run: yarn install --ignore-platform && cd node_modules/dugite && npm_config_arch=arm64 node script/download-git.js
+        working-directory: ./static
+
+      - name: Build/Release Electron App for arm64
+        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@v2
+        with:
+          name: logseq-linux-arm64-builds
+          path: builds
+
   build-macos-x64:
     needs: [ compile-cljs ]
     runs-on: macos-11

+ 1 - 0
resources/package.json

@@ -11,6 +11,7 @@
     "electron:debug": "electron-forge start --inspect-electron",
     "electron:make": "electron-forge make",
     "electron:make-macos-arm64": "electron-forge make --platform=darwin --arch=arm64",
+    "electron:make-linux-arm64": "electron-forge make --platform=linux --arch=arm64",
     "electron:publish:github": "electron-forge publish",
     "rebuild:better-sqlite3": "electron-rebuild -v 19.0.12 -f -w better-sqlite3",
     "rebuild:all": "electron-rebuild -v 19.0.12 -f",