GithubHelp home page GithubHelp logo

samuelmeuli / action-electron-builder Goto Github PK

View Code? Open in Web Editor NEW
650.0 650.0 197.0 144 KB

:electron: GitHub Action for building and releasing Electron apps

License: MIT License

JavaScript 100.00%
ci electron electron-builder github-action release-automation

action-electron-builder's People

Contributors

cawa-93 avatar dependabot[bot] avatar juliangruber avatar leclercb avatar marcmogdanz avatar rathboma avatar ream88 avatar samuelmeuli avatar wcatron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

action-electron-builder's Issues

Cannot Build MacOS App

Sorry to trouble you. The action cannot build app for MacOS while it works perfectly on other matrix.
Workflow: https://github.com/dd-center/Cator/blob/master/.github/workflows/shellbuild.yml
Failed Action: https://github.com/dd-center/Cator/runs/381204962
package.json: https://github.com/dd-center/Cator/blob/master/packages/cator-shell/package.json

Error: Exit code: 2. Command failed: /usr/bin/perl /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/t-M2nRmP/1-dmgProperties.pl
Can't locate Mac/Memory.pm in @INC (you may need to install the Mac::Memory module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/t-M2nRmP/1-dmgProperties.pl line 4.
BEGIN failed--compilation aborted at /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/t-M2nRmP/1-dmgProperties.pl line 4.

Google says brew unlink perl might be useful but I don't know how to do.
Thanks.

add release body

is it possible to add a release body? for example, with the actions/create-release@v1 action you can do this:

    - name: Create Release
      id: create_release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
      with:
        tag_name: ${{ github.ref }}
        release_name: Release ${{ github.ref }}
        body: |
          This is an automated release. See [the Changelog](link to my changelog) for more info.
        draft: false
        prerelease: false

Publish workflow

Hi, first thanks a lot for this Action!

I have a question, I'm pretty sure that part of it is about Github Releases, but I sure you can help me, and learn how we using your action.

So, I'm playing with your action, and like your example, I trigger the Release pipeline when a new tag start with v added.

But even if there is such tag, say v1.2.3, the Github Release will be 0.0.1, from the package.json.

My logic is like this:

  1. There is no meaning when setting a tag without updating the version in package.json (Even more - it's misleading).
  2. If we trigger the Release by pushing to master, until the version in package.json will change, all the releases files will upload to the current release.
  3. Github Releases are actually Git tags, so if you using this action, you don't need to use Tags to control the releases, but you control the releases tags by the version in package,json and the action.

The only problem is how to auto avoiding publish to release that no draft (I mean, you continue pushing to the master with 0.0.1 in package.json, so you have a Draft Release number 0.0.1, that always updated with your master. Then you apply the Github Release 0.0.1, and pushing to the master again, without updating the package.json to the next version. Now you have a public release that should not change, but each push to the master change it).

What do you think?

Sorry about my English.

Electron Builder Script not working

Hi. I am getting this error in the workflow

Building and releasing the Electron app…
not found: electron-builder
/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:144
				throw err;
				^

Error: Command failed: npx --no-install electron-builder --linux --publish always 
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
    at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:132:4)
    at Object.<anonymous> (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 127,
  signal: null,
  output: [ null, null, null ],
  pid: 2511,
  stdout: null,
  stderr: null
}

Should I add it in my dependencies?

Cache deps

Thanks a lot for sharing your code!


Issue

It would be awesome if we cache deps. This will speed up the process dramatically:

Cacheable Entries

  • node_modules
  • electron (ELECTRON_CACHE)
  • electron_builder (ELECTRON_BUILDER_CACHE)

Example

name: Release

on: [push]

jobs:
  test:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [macos-latest, windows-latest]
        # Lets use the preinstalled node version (much faster)
        node-version: [12.x]

    env:
      ELECTRON_CACHE: ${{ github.workspace }}/.cache/electron
      ELECTRON_BUILDER_CACHE: ${{ github.workspace }}/.cache/electron-builder

    steps:
      - name: Check out Git repository
        uses: actions/checkout@v1

      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Get yarn cache
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Cache Node.js modules
        uses: actions/cache@v1
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Cache Electron
        uses: actions/cache@v1
        with:
          path: ${{ github.workspace }}/.cache/electron
          key: ${{ runner.os }}-electron-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
          restore-keys: |
            ${{ runner.os }}-electron-cache-

      - name: Cache Electron-Builder
        uses: actions/cache@v1
        with:
          path: ${{ github.workspace }}/.cache/electron-builder
          key: ${{ runner.os }}-electron-builder-cache-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
          restore-keys: |
            ${{ runner.os }}-electron-builder-cache-

      - name: Install dependencies
        run: yarn install

      - name: Build Electron app
        uses: samuelmeuli/action-electron-builder@v1
        with:
          github_token: ${{ secrets.github_token }}

"Operation canceled" when building Windows app on macOS

Everytime I use the action, the operation gets canceled after downloading electron stuff.

Output:

Running the build script…

[email protected] build /Users/runner/runners/2.165.2/work/pushup-reminder/pushup-reminder
electron-builder --windows --linux

• electron-builder version=22.4.1 os=19.3.0
• loaded configuration file=package.json ("build" field)
• packaging platform=linux arch=x64 electron=8.1.1 appOutDir=dist/linux-unpacked
• downloading url=https://github.com/electron/electron/releases/download/v8.1.1/electron-v8.1.1-linux-x64.zip size=71 MB parts=8
• downloaded url=https://github.com/electron/electron/releases/download/v8.1.1/electron-v8.1.1-linux-x64.zip duration=1.906s
• building target=AppImage arch=x64 file=dist/pushups-reminder-1.0.0.AppImage
• packaging platform=win32 arch=x64 electron=8.1.1 appOutDir=dist/win-unpacked
• downloading url=https://github.com/electron/electron/releases/download/v8.1.1/electron-v8.1.1-win32-x64.zip size=71 MB parts=8
• downloading url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-12.0.1/appimage-12.0.1.7z size=1.6 MB parts=1
• downloaded url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-12.0.1/appimage-12.0.1.7z duration=878ms
• downloaded url=https://github.com/electron/electron/releases/download/v8.1.1/electron-v8.1.1-win32-x64.zip duration=2.994s
• downloading url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1
• downloaded url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z duration=1.932s
• downloading url=https://github.com/electron-userland/electron-builder-binaries/releases/download/wine-4.0.1-mac/wine-4.0.1-mac.7z size=19 MB parts=3
• downloaded url=https://github.com/electron-userland/electron-builder-binaries/releases/download/wine-4.0.1-mac/wine-4.0.1-mac.7z duration=684ms
##[error]The operation was canceled.

"electron-builder install-app-deps" get a error

`Will run NPM commands in directory "."

Installing dependencies using NPM…

[email protected] postinstall /home/runner/work/fpsmember/fpsmember
electron-builder install-app-deps

• electron-builder version=22.9.1
• loaded configuration file=package.json ("build" field)
⨯ spawn /home/runner/work/fpsmember/fpsmember/node_modules/app-builder-bin/linux/x64/app-builder EACCES stackTrace=
Error: spawn /home/runner/work/fpsmember/fpsmember/node_modules/app-builder-bin/linux/x64/app-builder EACCES
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: electron-builder install-app-deps
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-02-02T05_42_50_123Z-debug.log
child_process.js:660
throw err;
^

Error: Command failed: npm install
at checkExecSyncError (child_process.js:621:11)
at execSync (child_process.js:657:15)
at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:109:2)
at Object. (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150:1)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 12054,
stdout: null,
stderr: null
}`

Option to configure build script name

Thanks for the action script !
It would be nice to be able to configure the build script name.

For the moment, this is how my scripts are looking, it's pretty hard to get the git hash via a command that works on every system. So I created two build scripts:

"build": "REACT_APP_GIT_COMMIT_HASH=$(git rev-parse --short HEAD) craco build", "build:github": "craco build",

And in the build and release steps of my workflow I added:

env: REACT_APP_GIT_COMMIT_HASH: "${{ github.sha }}"

PS: The script is working fine, but no artifact is generated once the build is complete, is it normal ?

Thanks

TypeError: Cannot read property 'getType' of undefined

Hi @samuelmeuli ,

just since recently I'm running in issues with this action. The building is running through well, but as soon as the publishing to a tag starts, the process stops and runs into a TypeError: Cannot read property 'getType' of undefined which is part of electron-publish, which again is part of electron-builder. I'm using 22.10.5. Have you even stumbled accross this TypeError and can point me into the right direction how to solve it?

In case it matters, here is my package.json (https://github.com/ransome1/sleek/blob/develop/package.json) and here the full build log (https://github.com/ransome1/sleek/runs/2506836432?check_suite_focus=true)

I would really appreciate any help, as I can't publish my builds right now :(

yarn run v1.22.10
$ /home/runner/work/sleek/sleek/node_modules/.bin/electron-builder --linux --publish always
  • electron-builder  version=22.10.5 os=5.4.0-1046-azure
  • cannot check updates  error=TypeError: update_notifier_1.default is not a function
  • loaded configuration  file=package.json ("build" field)
  • packaging       platform=linux arch=x64 electron=12.0.6 appOutDir=dist/linux-unpacked
  • building        target=AppImage arch=x64 file=dist/sleek-1.0.3.AppImage
  • publishing      publisher=Github (owner: ransome1, project: sleek, version: 1.0.3)
  • building        target=deb arch=x64 file=dist/sleek_1.0.3_amd64.deb
  • uploading       file=sleek-1.0.3.AppImage provider=GitHub
  • building        target=freebsd arch=x64 file=dist/sleek-1.0.3.freebsd
  • uploading       file=sleek_1.0.3_amd64.deb provider=GitHub
  • building        target=rpm arch=x64 file=dist/sleek-1.0.3.x86_64.rpm
  • uploading       file=sleek-1.0.3.freebsd provider=GitHub
  • uploading       file=sleek-1.0.3.x86_64.rpm provider=GitHub
  ⨯ Cannot cleanup: 

Error #1 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)

Error #2 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)

Error #3 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)

Error #4 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)  failedTask=build stackTrace=Error: Cannot cleanup: 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Error #1 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Error #2 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Error #3 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Error #4 --------------------------------------------------------------------------------
TypeError: Cannot read property 'getType' of undefined
    at GitHubPublisher.doUploadFile (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:190:36)
    at GitHubPublisher.doUpload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/gitHubPublisher.ts:170:23)
    at GitHubPublisher.upload (/home/runner/work/sleek/sleek/node_modules/electron-publish/src/publisher.ts:87:5)
    at throwError (/home/runner/work/sleek/sleek/node_modules/builder-util/src/asyncTaskManager.ts:88:11)
    at checkErrors (/home/runner/work/sleek/sleek/node_modules/builder-util/src/asyncTaskManager.ts:53:9)
    at AsyncTaskManager.awaitTasks (/home/runner/work/sleek/sleek/node_modules/builder-util/src/asyncTaskManager.ts:58:5)
    at PublishManager.awaitTasks (/home/runner/work/sleek/sleek/node_modules/app-builder-lib/src/publish/PublishManager.ts:228:28)
    at /home/runner/work/sleek/sleek/node_modules/app-builder-lib/src/index.ts:114:32
    at Object.executeFinally (/home/runner/work/sleek/sleek/node_modules/builder-util/src/promise.ts:23:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:144
				throw err;
				^

Error: Command failed: yarn run electron-builder --linux --publish always 
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
    at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:132:4)
    at Object.<anonymous> (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 2369,
  stdout: null,
  stderr: null
}

Error: socket hang up

I'm getting this error pretty often during the upload phase.

  • building        target=DMG arch=x64 file=dist/LosslessCut-mac.dmg
  • building block map  blockMapFile=dist/LosslessCut-mac.dmg.blockmap
  • uploading       file=LosslessCut-mac.dmg.blockmap provider=GitHub
  • uploading       file=LosslessCut-mac.dmg provider=GitHub
  ⨯ socket hang up  stackTrace=
                      Error: socket hang up
                          at connResetException (internal/errors.js:608:14)
                          at TLSSocket.socketOnEnd (_http_client.js:460:23)
                          at TLSSocket.emit (events.js:322:22)
                          at endReadableNT (_stream_readable.js:1187:12)
                          at processTicksAndRejections (internal/process/task_queues.js:84:21)
  • overwrite published file  file=LosslessCut-mac.dmg.blockmap reason=already exists on GitHub
  • overwrite published file  file=LosslessCut-mac.dmg reason=already exists on GitHub
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
child_process.js:660
    throw err;
    ^

Error: Command failed: yarn run electron-builder --mac --publish always

I realize it's probably GitHub's fault for having unstable infrastructure, but I'm wondering if it's possible to implement some retry? Or maybe it needs to be done in electron-builder

Separate build and release jobs?

I want to be able to upload the built artifacts to be used by another job in the pipeline, and use them as part of another build step, and finally do the release at the end when all pipeline jobs have succeeded. Currently, I can't do this. Could the build and release steps be exposed separately, so I can do this? I don't want the release job to run until all stages in my pipeline have completed.

Possibly implementation would be to add a skip_release flag, so the job could be duplicated - once with skip_release, and once with skip_build.

Job [Seemingly] Randomly Succeeds

Overview

In setting up action-electron-builder for my GitHub Repo (located here) I'm having a lot of trouble getting this to work due to various failures in changing various configs.

Configs

After a lot of fiddling and Googling I've managed to get myself the following package.json and main.yaml:

package.json, main.yaml

Logs

macOS, Linux, Windows

I have many other logs that failed for various reasons but in the process of just trying to get this to work I've changed configs countless times, so it may be substantially more difficult to reproduce with those.


Am I missing something? In theory, the only thing that is different here than your default config is the max_attempts attribute that I set just in case, and even then that just makes it so there's a chance it might sometimes work. I can't tell if it's an issue with a lock on a file.

Job fails bsdtar command

Hi,
in my repository and branch: https://github.com/mlajtos/mosaic/pull/5/files

The Windows and Mac builds are ok, but Linux fails this way:

  ⨯ cannot execute  cause=exit status 1
                    out={:timestamp=>"2020-08-12T09:13:45.777839+0000", :message=>"Process failed: /bin/sh failed (exit code 127). Full command was:[\"/bin/sh\", \"-c\", \"LANG=C bsdtar -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' opt usr .PKGINFO .INSTALL\"]", :level=>:error}
    
                    command=/home/runner/.cache/electron-builder/fpm/fpm-1.9.3-2.3.1-linux-x86_64/fpm -s dir --force -t pacman -d c-ares -d ffmpeg -d gtk3 -d http-parser -d libevent -d libvpx -d libxslt -d libxss -d minizip -d nss -d re2 -d snappy -d libnotify -d libappindicator-gtk3 --pacman-compression xz --architecture amd64 --name mosaic-browser --after-install /tmp/t-GfXFMS/4-after-install --after-remove /tmp/t-GfXFMS/5-after-remove --description 'Web browser that can display multiple web pages at the same time in one shared window.
     Web browser that can display multiple web pages at the same time in one shared window.' --version 0.0.1 --package /home/runner/work/mosaic/mosaic/dist/mosaic-browser-0.0.1.pacman --maintainer 'Milan Lajtoš <[email protected]>' --url https://github.com/michalklempa/mosaic --vendor 'Milan Lajtoš <[email protected]>' --license MIT /home/runner/work/mosaic/mosaic/dist/linux-unpacked/=/opt/Mosaic /home/runner/work/mosaic/mosaic/build/icon.png=/usr/share/icons/hicolor/0x0/apps/mosaic.png /tmp/t-GfXFMS/9-Mosaic.desktop=/usr/share/applications/mosaic.desktop
                    workingDir=
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:144
				throw err;
				^

Error: Command failed: yarn run electron-builder --linux  
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
    at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:132:4)
    at Object.<anonymous> (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 2427,
  stdout: null,
  stderr: null
}

Any idea what might happen? I do not see stdout/err from the sh and bsdtar commands to investigate.

Release fails with 403 from GitHub API

Hi there, I am trying to use this fine action on a private repo.

Building works fine, however the release / publishing to GitHub fails with a 403. Here is the output:

2020-07-29T15:14:03.5631080Z Running the build script…
2020-07-29T15:14:03.8488620Z 
2020-07-29T15:14:03.8490070Z Building and releasing the Electron app…
2020-07-29T15:14:04.1967020Z   • electron-builder  version=22.8.0 os=19.6.0
2020-07-29T15:14:04.3610210Z   • loaded configuration  file=package.json ("build" field)
2020-07-29T15:14:04.7975230Z   • packaging       platform=darwin arch=x64 electron=9.1.1 appOutDir=dist/mac
2020-07-29T15:14:05.0681650Z   • downloading     url=https://github.com/electron/electron/releases/download/v9.1.1/electron-v9.1.1-darwin-x64.zip size=72 MB parts=8
2020-07-29T15:14:05.5645240Z   • downloaded      url=https://github.com/electron/electron/releases/download/v9.1.1/electron-v9.1.1-darwin-x64.zip duration=753ms
2020-07-29T15:14:11.6323690Z   • default Electron icon is used  reason=application icon is not set
2020-07-29T15:14:11.7897950Z   • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
2020-07-29T15:14:11.7898430Z                                                    0 identities found
2020-07-29T15:14:11.7898720Z                                               
2020-07-29T15:14:11.7899000Z                                                 Valid identities only
2020-07-29T15:14:11.7899260Z                                                    0 valid identities found
2020-07-29T15:14:11.7921890Z   • building        target=macOS zip arch=x64 file=dist/Prototype-0.0.1-mac.zip
2020-07-29T15:14:11.7925150Z   • building        target=DMG arch=x64 file=dist/Prototype-0.0.1.dmg
2020-07-29T15:14:54.9080440Z   • building embedded block map  file=dist/Prototype-0.0.1-mac.zip
2020-07-29T15:14:55.8183250Z   • publishing      publisher=Github (owner: electron, project: electron-quick-start, version: 0.0.1)
2020-07-29T15:14:55.8467140Z   • uploading       file=Prototype-0.0.1-mac.zip provider=GitHub
2020-07-29T15:14:56.5540610Z   • creating GitHub release  reason=release doesn't exist tag=v0.0.1 version=0.0.1
2020-07-29T15:15:42.0659830Z   • building block map  blockMapFile=dist/Prototype-0.0.1.dmg.blockmap
2020-07-29T15:15:42.9692560Z   • uploading       file=Prototype-0.0.1.dmg.blockmap provider=GitHub
2020-07-29T15:15:42.9693340Z   • uploading       file=Prototype-0.0.1.dmg provider=GitHub
2020-07-29T15:15:43.0456390Z   ⨯ Cannot cleanup: 
2020-07-29T15:15:43.0456690Z 
2020-07-29T15:15:43.0457650Z Error #1 --------------------------------------------------------------------------------
2020-07-29T15:15:43.0458000Z HttpError: 403 Forbidden
2020-07-29T15:15:43.0458310Z {
2020-07-29T15:15:43.0458500Z   "message": "Resource not accessible by integration",
2020-07-29T15:15:43.0459210Z   "documentation_url": "https://developer.github.com/v3/repos/releases/#create-a-release"
2020-07-29T15:15:43.0459510Z }
2020-07-29T15:15:43.0459750Z Headers: {
2020-07-29T15:15:43.0459940Z   "server": "GitHub.com",
2020-07-29T15:15:43.0460140Z   "date": "Wed, 29 Jul 2020 15:14:56 GMT",
2020-07-29T15:15:43.0460780Z   "content-type": "application/json; charset=utf-8",
2020-07-29T15:15:43.0461310Z   "content-length": "139",
2020-07-29T15:15:43.0462370Z   "connection": "close",
2020-07-29T15:15:43.0462570Z   "status": "403 Forbidden",
2020-07-29T15:15:43.0463140Z   "x-ratelimit-limit": "1000",
2020-07-29T15:15:43.0463700Z   "x-ratelimit-remaining": "979",
2020-07-29T15:15:43.0464210Z   "x-ratelimit-reset": "1596037747",
2020-07-29T15:15:43.0464750Z   "x-github-media-type": "github.v3; format=json",
2020-07-29T15:15:43.0465620Z   "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
2020-07-29T15:15:43.0466180Z   "access-control-allow-origin": "*",
2020-07-29T15:15:43.0466760Z   "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
2020-07-29T15:15:43.0467250Z   "x-frame-options": "deny",
2020-07-29T15:15:43.0467750Z   "x-content-type-options": "nosniff",
2020-07-29T15:15:43.0468270Z   "x-xss-protection": "1; mode=block",
2020-07-29T15:15:43.0468890Z   "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
2020-07-29T15:15:43.0469380Z   "content-security-policy": "default-src 'none'",
2020-07-29T15:15:43.0469930Z   "vary": "Accept-Encoding, Accept, X-Requested-With",
2020-07-29T15:15:43.0470490Z   "x-github-request-id": "C0D5:5C98:634319:E50146:5F21926F"
2020-07-29T15:15:43.0470750Z }
2020-07-29T15:15:43.0471510Z     at createHttpError (/Users/runner/work/electron-quick-start/electron-quick-start/node_modules/builder-util-runtime/src/httpExecutor.ts:30:10)
2020-07-29T15:15:43.0472310Z     at IncomingMessage.<anonymous> (/Users/runner/work/electron-quick-start/electron-quick-start/node_modules/builder-util-runtime/src/httpExecutor.ts:166:18)
2020-07-29T15:15:43.0472570Z     at IncomingMessage.emit (events.js:327:22)
2020-07-29T15:15:43.0472840Z     at endReadableNT (_stream_readable.js:1221:12)
2020-07-29T15:15:43.0473090Z     at processTicksAndRejections (internal/process/task_queues.js:84:21)
2020-07-29T15:15:43.0473220Z 
2020-07-29T15:15:43.0473940Z Error #2 --------------------------------------------------------------------------------
2020-07-29T15:15:43.0474240Z HttpError: 403 Forbidden
........

This is my .yml:

name: Build/release

on: push

jobs:
  release:
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [macos-latest, windows-latest]

    steps:
      - name: Check out Git repository
        uses: actions/checkout@v2
        with:
          submodules: true

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v1
        with:
          node-version: 12

      - name: Build/release Electron app
        uses: samuelmeuli/action-electron-builder@v1
        with:
          # GitHub token, automatically provided to the action
          # (No need to define this secret in the repo settings)
          github_token: ${{ secrets.GITHUB_TOKEN }}

          # If the commit is tagged with a version (e.g. "v1.0.0"),
          # release the app after building
          release: ${{ startsWith(github.ref, 'refs/tags/v') }}

Any ideas? Am I missing something?

Thank you,
Jan 👋


PS: I am Admin on the repo.

Cannot build macOS app

Hi, samuelmeuli and wcatron;
Thanks a lot for this Action.

I have error on github action.
my action file is copy is https://github.com/samuelmeuli/mini-diary/blob/master/.github/workflows/release.yml

I changed
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1

to

  - name: Build/release Electron app
    uses: samuelmeuli/action-electron-builder@master

only.

package.json
...
"scripts": {
"build": "yarn build-all && electron-builder --mac --windows",
"build-all": "concurrently "yarn build-main" "yarn build-renderer"",
"build-main": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.main.prod.babel.js --colors",
"build-renderer": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.renderer.prod.babel.js --colors",
"postinstall": "node -r @babel/register internals/scripts/CheckNativeDep.js && yarn flow-typed && electron-builder install-app-deps && yarn build-dll && opencollective-postinstall",
"release": "yarn build-all && electron-builder --mac --windows --publish always"
},
"build": {
"productName": "ElectronReact",
"appId": "com.tmksolutions.kztmk.electron_boilerplate",
"files": [
"dist/",
"node_modules/",
"app.html",
"main.prod.js",
"main.prod.js.map",
"package.json"
],
"mac": {
"hardenedRuntime": true,
"entitlements": "./app/build/entitlement.plist",
"entitlementsInherit": "./app/build/entitlement.plist"
},
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
]
},
"win": {
"target": [
{
"target":"nsis",
"arch":[
"ia32",
"x64"
]
}
]
},
"linux": {
"target": [
"deb",
"rpm",
"AppImage"
],
"category": "Development"
},
"directories": {
"buildResources": "resources",
"output": "release"
},
"publish": {
"provider": "github",
"owner": "kztmk",
"repo": "kztmk/kztmk-electron-boilerplate",
"private": false
}
},

So I have got error

⨯ Build for macOS is supported only on macOS, please see https://electron.build/multi-platform-build

on github action release(windows-2019)

Please tell me how I can correct this error.

Thanks.

ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

I am trying to configure then GH action and after a few hours, I am starting to giving up.

My repo is private but I believe I already fixed all issues related to access tokens. Dependencies are installed, build performed, but the publish action fails. I have a build that releases the app for Windows, Linux, and macOS. It always fils on Linux as it's faster than other platforms.

The action produces the following output (I am replacing GH org with xxx and repo name with yyy because it is a private repo of my organization):

Running the build script…

Building and releasing the Electron app…
  • electron-builder  version=22.9.1 os=5.4.0-1039-azure
  • loaded configuration  file=package.json ("build" field)
  • author is missed in the package.json  appPackageFile=/home/runner/work/yyy/yyy/package.json
  • packaging       platform=linux arch=x64 electron=11.2.3 appOutDir=dist/linux-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v11.2.3/electron-v11.2.3-linux-x64.zip size=76 MB parts=4
  • downloaded      url=https://github.com/electron/electron/releases/download/v11.2.3/electron-v11.2.3-linux-x64.zip duration=272ms
  • building        target=snap arch=x64 file=dist/domain-modeling-0.1.0-amd64.snap
  • building        target=AppImage arch=x64 file=dist/domain-modeling-0.1.0-x86_64.AppImage
  ⨯ expected argument for flag '--executable'  
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-12.0.1/appimage-12.0.1.7z size=1.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/appimage-12.0.1/appimage-12.0.1.7z duration=207ms
  ⨯ /home/runner/work/yyy/yyy/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
                                                                                                                                                                             Error: /home/runner/work/yyy/yyy/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                                                                                                                                 at ChildProcess.<anonymous> (/home/runner/work/yyy/yyy/node_modules/builder-util/src/util.ts:243:14)
                                                                                                                                                                                 at Object.onceWrapper (node:events:485:26)
                                                                                                                                                                                 at ChildProcess.emit (node:events:378:20)
                                                                                                                                                                                 at maybeClose (node:internal/child_process:1067:16)
                                                                                                                                                                                 at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
  • publishing      publisher=Github (owner: xxx, project: yyy, version: 0.1.0)
  • uploading       file=[masked-for-privacy]-0.1.0-x86_64.AppImage provider=GitHub
npm ERR! code 1
npm ERR! path /home/runner/work/yyy/yyy
npm ERR! command failed
npm ERR! command sh -c electron-builder "--linux" "--publish" "always"

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2021-02-12T07_38_08_096Z-debug.log
/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:144
				throw err;
				^

Error: Command failed: npx --no-install electron-builder --linux --publish always 
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
    at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:132:4)
    at Object.<anonymous> (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 2701,
  stdout: null,
  stderr: null
}

Any idea what that would be?

Set multiple signing certs

Hi,

Thanks much for this action. I'd like to use it to sign and notarize a .pkg installer which seems to require app and installer to be signed and notarized separately. For signing, there should be one application and one installer certificate but I do not see how I can provide those in the action.

Can you help me use the action for this purpose?

Thanks again!

Disabling publishing to Snapcraft

I was building my electron app locally & manually in the past using electron builder.
This produced a .snap file without issues which i was able to release via github releases.

Recently i switched to use your action to build directly on github.

The snap building part seems to fail because it it trying to release the app to snapcraft - which i basically don't event need.


2020-02-27T21:15:53.3000452Z   • publishing      publisher=Snap Store
2020-02-27T21:15:53.3001796Z   • uploading       file=media-dupes-0.5.20200227-linux-amd64.snap provider=snapStore
2020-02-27T21:15:56.1677832Z Preparing to push 'media-dupes-0.5.20200227-linux-amd64.snap'.
2020-02-27T21:15:56.1679530Z After pushing, the resulting snap revision will be released to 'edge' when it passes the Snap Store review.
2020-02-27T21:15:56.1680847Z Install the review-tools from the Snap Store for enhanced checks before uploading this snap.
2020-02-27T21:15:56.2256861Z You are required to login before continuing.
2020-02-27T21:15:56.2258538Z Enter your Ubuntu One e-mail address and password.
2020-02-27T21:15:56.2260891Z If you do not have an Ubuntu One account, you can create one at https://snapcraft.io/account
2020-02-27T21:15:57.0601847Z Authentication error: Failed to get unbound discharge: Invalid request data
2020-02-27T21:15:57.1236900Z   ⨯ exit status 2
2020-02-27T21:15:57.1249849Z github.com/develar/app-builder/pkg/util.ExecuteAndPipeStdOutAndStdErr
2020-02-27T21:15:57.1251260Z 	/Volumes/data/Documents/app-builder/pkg/util/exec.go:23
2020-02-27T21:15:57.1252312Z github.com/develar/app-builder/pkg/package-format/snap.publishToStore
2020-02-27T21:15:57.1253373Z 	/Volumes/data/Documents/app-builder/pkg/package-format/snap/snapStore.go:35
2020-02-27T21:15:57.1254889Z github.com/develar/app-builder/pkg/package-format/snap.ConfigurePublishCommand.func1
2020-02-27T21:15:57.1256023Z 	/Volumes/data/Documents/app-builder/pkg/package-format/snap/snapStore.go:18
2020-02-27T21:15:57.1256880Z github.com/alecthomas/kingpin.(*actionMixin).applyActions
2020-02-27T21:15:57.1257749Z 	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/actions.go:28
2020-02-27T21:15:57.1258607Z github.com/alecthomas/kingpin.(*Application).applyActions
2020-02-27T21:15:57.1259424Z 	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:557
2020-02-27T21:15:57.1260276Z github.com/alecthomas/kingpin.(*Application).execute
2020-02-27T21:15:57.1261082Z 	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:390
2020-02-27T21:15:57.1261930Z github.com/alecthomas/kingpin.(*Application).Parse
2020-02-27T21:15:57.1262744Z 	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:222
2020-02-27T21:15:57.1263504Z main.main
2020-02-27T21:15:57.1264392Z 	/Volumes/data/Documents/app-builder/main.go:90
2020-02-27T21:15:57.1265081Z runtime.main
2020-02-27T21:15:57.1265766Z 	/usr/local/Cellar/go/1.13.6/libexec/src/runtime/proc.go:203
2020-02-27T21:15:57.1266466Z runtime.goexit
2020-02-27T21:15:57.1267149Z 	/usr/local/Cellar/go/1.13.6/libexec/src/runtime/asm_amd64.s:1357  
2020-02-27T21:16:23.6333074Z   • building        target=deb arch=x64 file=dist/media-dupes-0.5.20200227-linux-amd64.deb

is it possible with your action to just build .snap and publish it to github releases like it is working for any other build (i.e. .deb / .AppImage etc)?

If so - how?

add retry option

Lately some builds have failed because of errors on apple servers, and we needed to manually restart these builds. It would be great if this action had an option to restart builds automatically, for a certain number of max retries.

out-of-date yarn warning

Hi, this action is a great time-saver. I noticed a warning today: this isn't a biggie probably but I figured should be brought forward nonetheless. Is it possible to use latest version of yarn? Another option would be to detect if yarn is already present, and use that instead? Thanks!

[Build/release/release]   🐳  docker cp src=/home/cyrus/.cache/act/[email protected] dst=/actions/
| 
| Will run Yarn commands in directory "."
| 
| Installing dependencies using Yarn…
yarn install v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
warning Your current version of Yarn is out of date. The latest version is "1.22.4", while you're on "1.16.0".
info To upgrade, run the following command:
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
Done in 16.57s.

How to deal with embedded.provisionprofile

Do you just add it to git? For travis I used to encrypt this, because there are some ids inside it of it, which I don't want everybody to know. How do you deal with that?

Building with linux VM for windows and certificate

My goal is to build with certificate for windows, with linux VM.
My configuration with runs-on: macos-latest works properly.

I tried runs-on: ubuntu-latest, since macos is expensive (1 macOS minute equals 10 regular minutes)

I could fix the first error with container: electronuserland/builder:wine

Error 1:

  • electron-builder  version=22.8.0 os=5.3.0-1034-azure
  • loaded configuration  file=package.json ("build" field)
  • packaging       platform=win32 arch=x64 electron=8.5.0 appOutDir=release/win-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v8.5.0/electron-v8.5.0-win32-x64.zip size=71 MB parts=4
  • downloaded      url=https://github.com/electron/electron/releases/download/v8.5.0/electron-v8.5.0-win32-x64.zip duration=527ms
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z duration=353ms
  ⨯ wine is required, please see https://electron.build/multi-platform-build#linux 

Now i get wine: '/github/home' is not owned by you and cant get further.

Error 2:

• electron-builder  version=22.8.0 os=5.3.0-1034-azure
• loaded configuration  file=package.json ("build" field)
• packaging       platform=win32 arch=x64 electron=8.5.0 appOutDir=release/win-unpacked
• downloading     url=https://github.com/electron/electron/releases/download/v8.5.0/electron-v8.5.0-win32-x64.zip size=71 MB parts=4
• downloaded      url=https://github.com/electron/electron/releases/download/v8.5.0/electron-v8.5.0-win32-x64.zip duration=517ms
• downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1
• downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z duration=387ms
⨯ cannot execute  cause=exit status 1
                errorOut=wine: '/github/home' is not owned by you, refusing to create a configuration directory there

                command=wine /github/home/.cache/electron-builder/winCodeSign/winCodeSign-2.6.0/rcedit-ia32.exe /__w/kvws-relaunch/kvws-relaunch/release/win-unpacked/EKBO-Datenpool.exe --set-version-string FileDescription EKBO-Datenpool --set-version-string ProductName EKBO-Datenpool --set-version-string LegalCopyright 'Copyright © 2020 Unique' --set-file-version 4.1.32 --set-product-version 4.1.32.0 --set-version-string InternalName EKBO-Datenpool --set-version-string OriginalFilename '' --set-version-string CompanyName Unique --set-icon /__w/kvws-relaunch/kvws-relaunch/release/.icon-ico/icon.ico
                workingDir=

Did someone make it work for windows with certificate?

Add option to set yarn network-timeout

I must have some huge dependency somewhere that caused my windows builds to fail with the following error:

Installing dependencies using Yarn…
yarn install v1.22.4
$ node ./internals/scripts/CheckYarn.js
[1/4] Resolving packages...
[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.9.1.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "D:\\a\\frc-video-splitter-3\\frc-video-splitter-3\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
child_process.js:660
    throw err;

I added my own yarn step to install the dependencies with a (much) longer timeout before action-electron-builder, but I feel this is redundant because action-electron-builder just trys to install them in the next step.

      - name: Install dependencies
        run: yarn install --network-timeout 600000

I'd be great if we could specify yarn arguments in this action.

Removing extra files from the release build

I would like to clean out a few of the files which are being generated from electron-builder and distributed with the release tag builds.

The mac build includes a .zip and a .dmg version -- I'd like to keep just the .dmg version. I would also like to remove the *.yml and *.blockmap files.

How would I disable these files from being generated or exported?

TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters

I'm not sure what's the problem and what is causing it, so I guess I'm asking more for a help.

Pollytron is an app based on electron-react-boilerplate. I'm trying to add your action but I'm ending up with ER_UNESCAPED_CHARACTERS. It's not clear to me what is the url that's not escaped as I'm not setting any (explicitly). Would you mind helping me to debug the problem?

Here are logs from the actions build:
https://github.com/laszukdawid/pollytron/runs/660183766?check_suite_focus=true

The error stack trace comes up 3 times, just after unloading step:

 Error #1 --------------------------------------------------------------------------------
TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters
    at new ClientRequest (_http_client.js:116:13)
    at request (https.js:289:10)
    at NodeHttpExecutor.createRequest (/home/runner/work/pollytron/pollytron/node_modules/builder-util/src/nodeHttpExecutor.ts:9:12)
    at cancellationToken.createPromise (/home/runner/work/pollytron/pollytron/node_modules/builder-util-runtime/src/httpExecutor.ts:84:28)
    at Promise (/home/runner/work/pollytron/pollytron/node_modules/builder-util-runtime/src/CancellationToken.ts:84:7)
    at new Promise (<anonymous>)
    at CancellationToken.createPromise (/home/runner/work/pollytron/pollytron/node_modules/builder-util-runtime/src/CancellationToken.ts:62:12)
    at NodeHttpExecutor.doApiRequest (/home/runner/work/pollytron/pollytron/node_modules/builder-util-runtime/src/httpExecutor.ts:83:30)
    at NodeHttpExecutor.request (/home/runner/work/pollytron/pollytron/node_modules/builder-util-runtime/src/httpExecutor.ts:73:17)
    at GitHubPublisher.githubRequest (/home/runner/work/pollytron/pollytron/node_modules/electron-publish/src/gitHubPublisher.ts:253:35)
    at GitHubPublisher.getOrCreateRelease (/home/runner/work/pollytron/pollytron/node_modules/electron-publish/src/gitHubPublisher.ts:91:33)
    at Lazy.GitHubPublisher._release (/home/runner/work/pollytron/pollytron/node_modules/electron-publish/src/gitHubPublisher.ts:30:102)
    at Lazy.get value [as value] (/home/runner/work/pollytron/pollytron/node_modules/lazy-val/src/main.ts:18:25)
    at GitHubPublisher.doUpload (/home/runner/work/pollytron/pollytron/node_modules/electron-publish/src/gitHubPublisher.ts:163:41)
    at GitHubPublisher.upload (/home/runner/work/pollytron/pollytron/node_modules/electron-publish/src/publisher.ts:86:16)

Files never get released/published

When following the guide here and doing everything stated it doesn't release the files and I get the following error:

GitHub release not created  reason=existing type not compatible with publishing type tag=v1.0.28 version=1.0.28 existingType=release publishingType=draft
  • skipped publishing  file=The-City-Of-Truro-Mariners---Management-Console-1.0.28.AppImage reason=existing type not compatible with publishing type tag=v1.0.28 version=1.0.28 existingType=release publishingType=draft
  • skipped publishing  file=latest-linux.yml reason=existing type not compatible with publishing type tag=v1.0.28 version=1.0.28 existingType=release publishingType=draft

Build for Arm ?

Is it possible to Build for Arm devices like the Pi with this action ?

Archives get published on latest tag -1

Hi, thanks for the action. It works perfectly, however, it releases the archives in a draft with of latest tag -1.
In this log you can see the version is v0.1.12, but is published to v0.1.11.

Seems i forgot to ctrl-save my package.json

redacted

Repository in Organization Account

I guess this might be a question for electron-builder but I was wondering if you've ever seen a 404 error from the GitHub API come when this action attempts to publish for a repository in an Organization Account? Is it possible that the GITHUB_TOKEN that is generated automatically in actions does not have enough permissions to work with Organization repositories?

You can see my main.yml here but it should look pretty familiar :-)

Thank you very much for this action by the way!

Will run Yarn commands in directory "."

Installing dependencies using Yarn…
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "immutable@^3.8.1 || ^4.0.0-rc.1".
warning " > [email protected]" has unmet peer dependency "seamless-immutable@^7.1.3".
warning " > [email protected]" has unmet peer dependency "react-is@>= 16.8.0".
[4/4] Building fresh packages...
$ electron-builder install-app-deps
  • electron-builder  version=22.5.1
  • loaded configuration  file=/Users/runner/runners/2.169.0/work/hydrator/hydrator/electron-builder.yml
Done in 54.93s.

Running the build script…
Building the Electron app…
yarn run v1.22.4
$ /Users/runner/runners/2.169.0/work/hydrator/hydrator/node_modules/.bin/electron-builder --mac
  • electron-builder  version=22.5.1 os=19.4.0
  • artifacts will be published if draft release exists  reason=CI detected
  • loaded configuration  file=/Users/runner/runners/2.169.0/work/hydrator/hydrator/electron-builder.yml
  • packaging       platform=darwin arch=x64 electron=8.2.3 appOutDir=dist/mac
  • downloading     url=https://github.com/electron/electron/releases/download/v8.2.3/electron-v8.2.3-darwin-x64.zip size=66 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v8.2.3/electron-v8.2.3-darwin-x64.zip duration=1.134s
  • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
                                                   0 identities found
                                              
                                                Valid identities only
                                                   0 valid identities found
  • building        target=DMG arch=x64 file=dist/Hydrator-0.0.4.dmg
  • building block map  blockMapFile=dist/Hydrator-0.0.4.dmg.blockmap
  • publishing      publisher=Github (owner: docnow, project: hdyrator, version: 0.0.4)
  • uploading       file=Hydrator-0.0.4.dmg.blockmap provider=GitHub
  ⨯ Cannot cleanup: 

Error #1 --------------------------------------------------------------------------------
HttpError: 404 Not Found
"method: GET url: https://api.github.com/repos/docnow/hdyrator/releases\n\nPlease double check that your authentication token is correct. Due to security reasons actual status maybe not reported, but 404.\n"
Headers: {
  "server": "GitHub.com",
  "date": "Sat, 18 Apr 2020 09:38:57 GMT",
  "content-type": "application/json; charset=utf-8",
  "content-length": "124",
  "connection": "close",
  "status": "404 Not Found",
  "x-ratelimit-limit": "1000",
  "x-ratelimit-remaining": "996",
  "x-ratelimit-reset": "1587205272",
  "x-github-media-type": "github.v3; format=json",
  "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
  "access-control-allow-origin": "*",
  "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
  "x-frame-options": "deny",
  "x-content-type-options": "nosniff",
  "x-xss-protection": "1; mode=block",
  "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
  "content-security-policy": "default-src 'none'",
  "vary": "Accept-Encoding, Accept, X-Requested-With",
  "x-github-request-id": "5ECA:5AA2:484874:7AD07E:5E9ACAB1"
}
    at createHttpError (/Users/runner/runners/2.169.0/work/hydrator/hydrator/node_modules/builder-util-runtime/src/httpExecutor.ts:30:10)
    at NodeHttpExecutor.handleResponse (/Users/runner/runners/2.169.0/work/hydrator/hydrator/node_modules/builder-util-runtime/src/httpExecutor.ts:131:14)
    at ClientRequest.<anonymous> (/Users/runner/runners/2.169.0/work/hydrator/hydrator/node_modules/builder-util-runtime/src/httpExecutor.ts:86:16)
    at Object.onceWrapper (events.js:417:26)
    at ClientRequest.emit (events.js:310:20)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:603:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
    at TLSSocket.socketOnData (_http_client.js:476:22)
    at TLSSocket.emit (events.js:310:20)
    at addChunk (_stream_readable.js:286:12)
    at readableAddChunk (_stream_readable.js:268:9)
    at TLSSocket.Readable.push (_stream_readable.js:209:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23)

App build work, but artifacts are not publishing

Thank you for your great project!
I cloned your mini-diary repo and played with builds. Build action is triggered, build is OK, but artifacts are not publishing.
As far as I understand from your documentation, build action is publishing by default. Am I wrong?
When I run build manually on my MacOS, 'yarn build' builds app, and 'electron-builder build --mac --win --publish always' builds and publishes.

Thank you again,
Vitaly

Failed to download action

I copy build.yaml from https://github.com/samuelmeuli/mini-diary/blob/master/.github/workflows/release.yml , and when I push commit to master, action failed with Failed to download action.
Logs:

2019-11-17T14:36:35.5549329Z ##[section]Starting: Request a runner to run this job
2019-11-17T14:36:36.5730105Z Requesting a hosted runner in current repository's account/organization with labels: 'macos-10.14', require runner match: True
2019-11-17T14:36:36.6680005Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2019-11-17T14:36:36.7033118Z ##[section]Finishing: Request a runner to run this job
2019-11-17T14:36:51.3950250Z Current runner version: '2.160.2'
2019-11-17T14:36:51.3952170Z Prepare workflow directory
2019-11-17T14:36:51.4253570Z Prepare all required actions
2019-11-17T14:36:51.4283350Z Download action repository 'actions/checkout@v1'
2019-11-17T14:36:52.0711750Z Download action repository 'actions/setup-node@v1'
2019-11-17T14:36:53.1221420Z Download action repository 'samuelmeuli/action-electron-builder@v1'
2019-11-17T14:36:53.3762540Z ##[warning]Failed to download action 'https://api.github.com/repos/samuelmeuli/action-electron-builder/tarball/v1'. Error Response status code does not indicate success: 404 (Not Found).
2019-11-17T14:36:53.3769230Z ##[warning]Back off 28.663 seconds before retry.
2019-11-17T14:37:22.3056690Z ##[warning]Failed to download action 'https://api.github.com/repos/samuelmeuli/action-electron-builder/tarball/v1'. Error Response status code does not indicate success: 404 (Not Found).
2019-11-17T14:37:22.3059050Z ##[warning]Back off 26.215 seconds before retry.
2019-11-17T14:37:48.8101150Z ##[error]Response status code does not indicate success: 404 (Not Found).

My build.yaml:

name: Build/release

on: push

jobs:
  release:
    runs-on: ${{ matrix.os }}

    # Platforms to build on/for
    strategy:
      matrix:
        os: [macos-10.14, windows-2019, ubuntu-18.04]

    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: 10

      - name: Build/release Electron app
        uses: samuelmeuli/action-electron-builder@v1
        with:
          # GitHub token, automatically provided to the action
          # (No need to define this secret in the repo settings)
          github_token: ${{ secrets.github_token }}

          # macOS code signing certificate
          mac_certs: ${{ secrets.mac_certs }}
          mac_certs_password: ${{ secrets.mac_certs_password }}

          # If the commit is tagged with a version (e.g. "v1.0.0"),
          # release the app after building
          release: ${{ startsWith(github.ref, 'refs/tags/v') }}

"Cannot find module"

An odd error, because it works fine if I build it locally, but if I let the GH action build it and then download and install the app I get this error.

Error: Cannot find module '/Applications/my-app.app/Contents/Resources/app.asar/public/server/index.js'

https://github.com/nichoth/my-app

Can not get the action to work,

I am having the bellow issue:

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
child_process.js:660
    throw err;
    ^
Error: Command failed: yarn
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (D:\a\_actions\samuelmeuli\action-electron-builder\v1.6.0\index.js:21:27)
    at runAction (D:\a\_actions\samuelmeuli\action-electron-builder\v1.6.0\index.js:109:2)
    at Object.<anonymous> (D:\a\_actions\samuelmeuli\action-electron-builder\v1.6.0\index.js:150:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 1

How Can I fix it?

Add option to skip npm install completely

I am using this action in a step after I have already installed the node modules for my package. I don't want to install the node modules again. In my case, I'm using a mono repo where the packages are bootstrapped (lerna bootstrap) to use the versions only available locally and not yet published to npm. Running yarn within the package directory tries to download the new version from the registry and fails.

GitHub Personal Access Token ("***") contains invalid characters, please check env "GH_TOKEN"

Hi,
I was trying to draft a new release, but the build failed.

Here is the log:

Releasing the Electron app…

• electron-builder version=21.2.0 os=5.0.0-1023-azure

• loaded configuration file=package.json ("build" field)

• packaging platform=linux arch=x64 electron=7.1.1 appOutDir=dist/linux-unpacked

• building target=AppImage arch=x64 file=dist/Interclip-0.0.5.AppImage

⨯ GitHub Personal Access Token ("***") contains invalid characters, please check env "GH_TOKEN"
child_process.js:655

throw err;
^

But the documentation of this action says that the GH token is generated automatically, so where's the problem?

How release to Amazon S3

Is there an example of how to release the Electron app to S3? I looked into the documentation but I didn't find an example about it (maybe the args option?), I'm a little lost so if someone can help I'd appreciate :)

Official config releases on more than just tags

The readme suggests that in order to only build version tags, I should use:

with:
  release: ${{ startsWith(github.ref, 'refs/tags/v') }}

However, I don't think this is correct. When I push a tag, my GitHub Action runs for both the commit to master and the tag that points to it, which expected. However, in both cases, a release occurs:

  • v0.1.9 tag:

       • publishing      publisher=Github (owner: ***, project: ***, version: 0.1.9)
       • uploading       file=***-0.1.9.dmg.blockmap provider=GitHub
       • uploading       file=***-0.1.9.dmg provider=GitHub
       • creating GitHub release  reason=release doesn't exist tag=v0.1.9 version=0.1.9
    
  • commit on master branch (different build with identical code):

       • publishing      publisher=Github (owner: ***, project: ***, version: 0.1.9)
       • uploading       file=***-0.1.9.dmg.blockmap provider=GitHub
       • uploading       file=***-0.1.9.dmg provider=GitHub
       • overwrite published file  file=***-0.1.9.dmg.blockmap reason=already exists on GitHub
       • overwrite published file  file=***-0.1.9.dmg reason=already exists on GitHub
    

I believe github.ref is set to the tag on which the commit is based, rather than only being equal to refs/tags/v... for the run for the actual tag.

To make matters worse, the ref also appears to be set even if the branch is ahead of the tag. I updated my build config to change the output filename, pushed that change, and it added the resulting files (with the new filename) to the last release!

I hope I'm doing something wrong but since I just copied the release config verbatim, I'm not sure where to look.

Unfortunately, this is for a private repo, but it should be easy to reproduce.

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.