Skip to content

Commit

Permalink
Actions electron: test docker export matrix os + direct electron-buil…
Browse files Browse the repository at this point in the history
…der script
  • Loading branch information
fxi committed Mar 27, 2024
1 parent e07981d commit c6f2826
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/electron.yml
Expand Up @@ -10,9 +10,16 @@ jobs:

update_image:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: ubutu-latest
arch: amd64
- os: macos-14
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Use docker
- name: Use docker
uses: actions-hub/docker/cli@master
env:
SKIP_LOGIN: true
Expand All @@ -23,21 +30,33 @@ jobs:
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: accessmod_docker_archive
name: accessmod-docker-archive-${{ matrix.arch }}
path: ./electron/app/docker/accessmod-docker.tar.gz

build:
runs-on: ${{ matrix.os }}
needs: update_image
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
include:
- os: macos-14
platform: mac
arch: arm64
- os: macos-12
platform: mac
arch: amd64
- os: windows-2022
platform: win
arch: amd64
- os: ubuntu-22.04
platform: linux
arch: amd64
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: accessmod_docker_archive
name: accessmod-docker-archive-${{ matrix.arch }}
path: ./electron/app/docker/

- name: Use Node.js 18.x
Expand All @@ -46,18 +65,15 @@ jobs:
node-version: 18.x

- name: Install Dependencies
working-directory: ./electron
run: yarn install

- name: Build Electron App
uses: samuelmeuli/action-electron-builder@v1
with:
package_root: ./electron/
args: --${{ matrix.target }}
github_token: ${{ secrets.github_token }}
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name : Build
working-directory: ./electron
run : yarn run dist-${{ matrix.platform }}-${{ matrix.arch }}

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: accessmod_desktop_${{ matrix.os }}
name: accessmod-desktop-${{ matrix.os }}--${{ matrix.arch }}
path: ./electron/dist/*
2 changes: 1 addition & 1 deletion .github/workflows/packer.yml
Expand Up @@ -46,5 +46,5 @@ jobs:
- name: Upload OVA
uses: actions/upload-artifact@v3
with:
name: accessmod_virtual_box
name: accessmod-virtualbox
path: packer/_build
7 changes: 6 additions & 1 deletion electron/package.json
Expand Up @@ -37,7 +37,12 @@
},
"scripts": {
"pack": "electron-builder --dir",
"dist": "electron-builder",
"dist-mac-amd64": "electron-builder --mac --x64",
"dist-win-amd64": "electron-builder --win --x64",
"dist-linux-amd64": "electron-builder --linux --x64",
"dist-mac-arm64": "electron-builder --mac --arm64",
"dist-win-arm64": "echo 'not supported'",
"dist-linux-arm64": "echo 'not supported'",
"lint": "eslint .",
"start": "electron .",
"start:debug": "electron --inspect-brk=9229 .",
Expand Down

0 comments on commit c6f2826

Please sign in to comment.