{"id":13401953,"url":"https://github.com/samuelmeuli/action-electron-builder","last_synced_at":"2025-10-13T22:30:31.795Z","repository":{"id":36253733,"uuid":"221771926","full_name":"samuelmeuli/action-electron-builder","owner":"samuelmeuli","description":":electron: GitHub Action for building and releasing Electron apps","archived":true,"fork":false,"pushed_at":"2024-05-26T19:04:40.000Z","size":144,"stargazers_count":663,"open_issues_count":41,"forks_count":206,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-20T04:07:04.539Z","etag":null,"topics":["ci","electron","electron-builder","github-action","release-automation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samuelmeuli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-14T19:31:20.000Z","updated_at":"2024-10-20T02:24:26.000Z","dependencies_parsed_at":"2024-06-18T10:45:48.174Z","dependency_job_id":"c992fb74-489f-4402-9771-53e2da4a3c56","html_url":"https://github.com/samuelmeuli/action-electron-builder","commit_stats":{"total_commits":62,"total_committers":9,"mean_commits":6.888888888888889,"dds":"0.14516129032258063","last_synced_commit":"e4b12cd06ddf023422f1ac4e39632bd76f6e6928"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Faction-electron-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Faction-electron-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Faction-electron-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Faction-electron-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuelmeuli","download_url":"https://codeload.github.com/samuelmeuli/action-electron-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236409044,"owners_count":19144223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","electron","electron-builder","github-action","release-automation"],"created_at":"2024-07-30T19:01:09.723Z","updated_at":"2025-10-13T22:30:26.520Z","avatar_url":"https://github.com/samuelmeuli.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Community Resources"],"sub_categories":["Deployment"],"readme":"# Electron Builder Action\n\n**GitHub Action for building and releasing Electron apps**\n\nThis 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.\n\nGitHub Actions allows you to build your app on macOS, Windows and Linux without needing direct access to each of these operating systems.\n\n## Setup\n\n1. **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).\n\n2. 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.\n\n3. **Add a workflow file** to your project (e.g. `.github/workflows/build.yml`):\n\n   ```yml\n   name: Build/release\n\n   on: push\n\n   jobs:\n     release:\n       runs-on: ${{ matrix.os }}\n\n       strategy:\n         matrix:\n           os: [macos-latest, ubuntu-latest, windows-latest]\n\n       steps:\n         - name: Check out Git repository\n           uses: actions/checkout@v1\n\n         - name: Install Node.js, NPM and Yarn\n           uses: actions/setup-node@v1\n           with:\n             node-version: 10\n\n         - name: Build/release Electron app\n           uses: samuelmeuli/action-electron-builder@v1\n           with:\n             # GitHub token, automatically provided to the action\n             # (No need to define this secret in the repo settings)\n             github_token: ${{ secrets.github_token }}\n\n             # If the commit is tagged with a version (e.g. \"v1.0.0\"),\n             # release the app after building\n             release: ${{ startsWith(github.ref, 'refs/tags/v') }}\n   ```\n\n## Usage\n\n### Building\n\nUsing this the workflow above, GitHub will build your app every time you push a commit.\n\n### Releasing\n\nWhen you want to create a new release, follow these steps:\n\n1. Update the version in your project's `package.json` file (e.g. `1.2.3`)\n2. Commit that change (`git commit -am v1.2.3`)\n3. Tag your commit (`git tag v1.2.3`). Make sure your tag name's format is `v*.*.*`. Your workflow will use this tag to detect when to create a release\n4. Push your changes to GitHub (`git push \u0026\u0026 git push --tags`)\n\nAfter building successfully, the action will publish your release artifacts. By default, a new release draft will be created on GitHub with download links for your app. If you want to change this behavior, have a look at the [`electron-builder` docs](https://www.electron.build).\n\n## Configuration\n\n### Options\n\nYou can configure the action further with the following options:\n\n- `package_root`: Directory where NPM/Yarn commands should be run (default: `\".\"`)\n- `build_script_name`: Name of the optional NPM build script which is executed before `electron-builder` (default: `\"build\"`)\n- `skip_build`: Whether the action should execute the NPM build script before running `electron-builder`\n- `use_vue_cli`: Whether to run `electron-builder` using the [Vue CLI plugin](https://nklayman.github.io/vue-cli-plugin-electron-builder) instead of calling the command directly\n- `args`: Other arguments to pass to the `electron-builder` command, e.g. configuration overrides (default: `\"\"`)\n- `max_attempts`: Maximum number of attempts for completing the build and release step (default: `1`)\n\nSee [`action.yml`](./action.yml) for a list of all possible input variables.\n\n### Code Signing\n\nIf you are building for **macOS**, you'll want your code to be [signed](https://samuelmeuli.com/blog/2019-04-07-packaging-and-publishing-an-electron-app/#code-signing). GitHub Actions therefore needs access to your code signing certificates:\n\n- Open the Keychain Access app or the Apple Developer Portal. Export all certificates related to your app into a _single_ file (e.g. `certs.p12`) and set a strong password\n- Base64-encode your certificates using the following command: `base64 -i certs.p12 -o encoded.txt`\n- In your project's GitHub repository, go to Settings → Secrets and add the following two variables:\n  - `mac_certs`: Your encoded certificates, i.e. the content of the `encoded.txt` file you created before\n  - `mac_certs_password`: The password you set when exporting the certificates\n\nAdd the following options to your workflow's existing `action-electron-builder` step:\n\n```yml\n- name: Build/release Electron app\n  uses: samuelmeuli/action-electron-builder@v1\n  with:\n    # ...\n    mac_certs: ${{ secrets.mac_certs }}\n    mac_certs_password: ${{ secrets.mac_certs_password }}\n```\n\nThe same goes for **Windows** code signing (`windows_certs` and `windows_certs_password` secrets).\n\n### Snapcraft\n\nIf you are building/releasing your Linux app for Snapcraft (which is `electron-builder`'s default), you will additionally need to install and sign in to Snapcraft. This can be done using an `action-snapcraft` step before the `action-electron-builder` step:\n\n```yml\n- name: Install Snapcraft\n  uses: samuelmeuli/action-snapcraft@v1\n  # Only install Snapcraft on Ubuntu\n  if: startsWith(matrix.os, 'ubuntu')\n  with:\n    # Log in to Snap Store\n    snapcraft_token: ${{ secrets.snapcraft_token }}\n```\n\nYou can read [here](https://github.com/samuelmeuli/action-snapcraft) how you can obtain a `snapcraft_token`.\n\n### Notarization\n\nIf you've configured `electron-builder` to notarize your Electron Mac app [as described in this guide](https://samuelmeuli.com/blog/2019-12-28-notarizing-your-electron-app), you can use the following steps to let GitHub Actions perform the notarization for you:\n\n1.  Define the following secrets in your repository's settings on GitHub:\n\n    - `api_key`: Content of the API key file (with the `p8` file extension)\n    - `api_key_id`: Key ID found on App Store Connect\n    - `api_key_issuer_id`: Issuer ID found on App Store Connect\n\n2.  In your workflow file, add the following step before your `action-electron-builder` step:\n\n    ```yml\n    - name: Prepare for app notarization\n      if: startsWith(matrix.os, 'macos')\n      # Import Apple API key for app notarization on macOS\n      run: |\n        mkdir -p ~/private_keys/\n        echo '${{ secrets.api_key }}' \u003e ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8\n    ```\n\n3.  Pass the following environment variables to `action-electron-builder`:\n\n    ```yml\n    - name: Build/release Electron app\n      uses: samuelmeuli/action-electron-builder@v1\n      with:\n        # ...\n      env:\n        # macOS notarization API key\n        API_KEY_ID: ${{ secrets.api_key_id }}\n        API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}\n    ```\n\n## Example\n\nFor an example of the action used in production (including app notarization and publishing to Snapcraft), see [Mini Diary](https://github.com/samuelmeuli/mini-diary).\n\n## Development\n\nSuggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.\n\n## Related\n\n- [Snapcraft Action](https://github.com/samuelmeuli/action-snapcraft) – GitHub Action for setting up Snapcraft\n- [Lint Action](https://github.com/samuelmeuli/lint-action) – GitHub Action for detecting and fixing linting errors\n- [Maven Publish Action](https://github.com/samuelmeuli/action-maven-publish) – GitHub Action for automatically publishing Maven packages\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmeuli%2Faction-electron-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelmeuli%2Faction-electron-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmeuli%2Faction-electron-builder/lists"}