Giter Club home page Giter Club logo

action-electron-compiler's Introduction

GitHub action for electron-builder

Easy, cleaned and updated action for building, compiling and releasing Electron applications

This is a GitHub Action for building and compiling Electron applications with GitHub CI/CD. It uses electron-builder to compile and package the appication and optionally release it to a platform of your choice.

This action is an updated, refactored and cleaned up version of samuelmeuli/action-electron-builder. The action hasn't gotten any updates in over 2 years and it was missing some basic features such as PNPM support. Basically a no nonsense action for Electron.

Setup

  1. Configure your application and electron-builder.

  2. Configure your workflow script. Either run build before we package electron or we run build default before packaging. You can configure this.

  3. Add a workflow file to your project (e.g. .github/workflows/build.yml):

    name: Build/release
    
    on: push
    
    jobs:
        release:
            runs-on: ${{ matrix.os }}
    
            strategy:
                matrix:
                    os: [macos-latest, ubuntu-latest, windows-latest]
    
            steps:
                - name: Check out Git repository
                  uses: actions/checkout@v1
    
                - name: Install Node.js, NPM and Yarn
                  uses: actions/setup-node@v1
                  with:
                      node-version: 16
    
                - name: Compile Electron App
                  uses: x6Pnda/action-electron-compiler@v1
                  with:
                      # GitHub token, automatically provided to the action
                      # (Optional)
                      github_token: ${{ secrets.github_token }}
    
                      # If the commit is tagged with a version (e.g. "v1.0.0"),
                      # (Optional)
                      release: ${{ startsWith(github.ref, 'refs/tags/v') }}
    
                      # Package manager. NPM, PNPM and Yarn supported. Install Yarn and PNPM yourself. Default is NPM
                      # (Optional)
                      package_manager: NPM
    
                      # Skip buiding the application
                      # (Optional)
                      skip_build: false

There are more options located in the action.yml file. Good luck.

Usage

Building

Using this the workflow above, GitHub will build your app every time you push a commit.

Releasing

When you want to create a new release, follow these steps:

  1. Update the version in your project's package.json file (e.g. 1.2.3)
  2. Commit that change (git commit -am v1.2.3)
  3. 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
  4. Push your changes to GitHub (git push && git push --tags)

After 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.

Configuration

Notarization

Use your aftersign script. Make your life easy and copy paste it from @electron/notarize. You can use the environment variables APPLE_ID and APPLE_ID_PASSWORD to get the variables set inside the action. Will look into Windows at a later time. The point of this action is to compile, not to notarize. Don't create unicorns...

Development

Create an issue or suggestion. Before submitting: don't overcomplicate things. Think is it really needed or something which makes it harder for other users.

action-electron-compiler's People

Contributors

seydx avatar x6pnda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.