Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Added arm support on macOS (M1/M2) #86

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Electron Builder Action

## This action is maintened, all PRs will be reviewed :)
**GitHub Action for building and releasing Electron apps**

This is a GitHub Action for automatically building and releasing your Electron app using GitHub's CI/CD capabilities. It uses [`electron-builder`](https://github.com/electron-userland/electron-builder) to package your app and release it to a platform like GitHub Releases.
Expand All @@ -8,7 +8,7 @@ GitHub Actions allows you to build your app on macOS, Windows and Linux without

## Setup

1. **Install and configure `electron-builder`** (v22+) in your Electron app. You can read about this in [the project's docs](https://www.electron.build) or in [my blog post](https://samuelmeuli.com/blog/2019-04-07-packaging-and-publishing-an-electron-app).
1. **Install and configure `electron-builder`** (v22+) in your Electron app. You can read about this in [the project's docs](https://www.electron.build) or in [Samuel's blog post](https://samuelmeuli.com/blog/2019-04-07-packaging-and-publishing-an-electron-app).

2. If you need to compile code (e.g. TypeScript to JavaScript or Sass to CSS), make sure this is done using a **`build` script in your `package.json` file**. The action will execute that script before packaging your app. However, **make sure that the `build` script does _not_ run `electron-builder`**, as this action will do that for you.

Expand All @@ -34,10 +34,10 @@ GitHub Actions allows you to build your app on macOS, Windows and Linux without
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 10
node-version: 16

- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
uses: Yan-Jobs/action-electron-builder@v1.7.0
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
Expand All @@ -47,7 +47,7 @@ GitHub Actions allows you to build your app on macOS, Windows and Linux without
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
```

- On macOS it will also create an arm release for your M1/M2 users
## Usage

### Building
Expand Down Expand Up @@ -161,8 +161,5 @@ For an example of the action used in production (including app notarization and

Suggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.

## Related

- [Snapcraft Action](https://github.com/samuelmeuli/action-snapcraft) – GitHub Action for setting up Snapcraft
- [Lint Action](https://github.com/samuelmeuli/lint-action) – GitHub Action for detecting and fixing linting errors
- [Maven Publish Action](https://github.com/samuelmeuli/action-maven-publish) – GitHub Action for automatically publishing Maven packages
## Credits
Thanks Samuel Meuli for the work: https://github.com/samuelmeuli/action-electron-builder
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Electron Builder Action
author: Samuel Meuli
name: Electron Builder Action (Maintened)
author: YanJobs & Samuel Meuli
description: GitHub Action for building and releasing Electron apps

inputs:
Expand Down Expand Up @@ -53,7 +53,7 @@ inputs:
required: false

runs:
using: node12
using: node16
main: index.js

branding:
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const runAction = () => {
run(
`${useNpm ? "npx --no-install" : "yarn run"} ${cmd} --${platform} ${
release ? "--publish always" : ""
} ${args}`,
} ${(platform == "mac") ? "--arm64 --x64" : ""} ${args}`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you can configure a universal build as well should this be something that is flagged?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that’s not a bad idea. I’ll look into it…
- Yan

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strategy:
      matrix:
        os: [macos-latest, windows-latest]
        arch: ["--x64", "--arm64"]

- name: Build/release Electron app
        uses: samuelmeuli/action-electron-builder@v1
        with:
          args: ${{ matrix.arch }}

appRoot,
);
break;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "action-electron-builder",
"version": "1.6.0",
"version": "1.7.0",
"description": "GitHub Action for building and releasing Electron apps",
"author": {
"name": "Samuel Meuli",
Expand Down