Skip to content

Commit

Permalink
Merge build steps for multiple platforms (#931)
Browse files Browse the repository at this point in the history
In order to have a single electron build step, utilize the workflow input.
  • Loading branch information
aadnekar authored Dec 18, 2023
1 parent ff62fdd commit e3a9231
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
runner:
required: true
type: string # [Windows, macOS, Linux]
electronArgument:
required: true
type: string # e.g. --windows nsis:x64

jobs:
build:
Expand All @@ -27,15 +30,8 @@ jobs:
- name: Build for Production
run: npm run build:prod

- name: Run Electron Builder (Windows)
if: runner.os == 'Windows'
run: npx electron-builder -p never --windows nsis:x64
- name: Run Electron Builder (macOS)
if: runner.os == 'macOS'
run: npx electron-builder -p never --x64
- name: Run Electron Builder (Linux)
if: runner.os == 'Linux'
run: npx electron-builder -p never
- name: Run Electron Builder
run: npx electron-builder -p never ${{ inputs.electronArgument }}

- name: Publish built artifact
uses: actions/upload-artifact@v3
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ jobs:
uses: ./.github/workflows/build.yml
with:
runner: windows-latest
electronArgument: --windows nsis:x64
build_on_ubuntu:
uses: ./.github/workflows/build.yml
with:
runner: ubuntu-latest
electronArgument: ''

# build_on_mac_intel:
# uses: ./.github/workflows/build.yml
# with:
# runner: macos-latest
# electronArgument: --x64
# build_on_mac_apple_silicon:
# uses: ./.github/workflows/build.yml
# with:
# runner: macos-latest-xlarge
# electronArgument:

0 comments on commit e3a9231

Please sign in to comment.