forge icon indicating copy to clipboard operation
forge copied to clipboard

Unable to build Flatpak on GitHub Actions

Open Aditya-ds-1806 opened this issue 3 years ago • 3 comments
trafficstars

Pre-flight checklist

  • [X] I have read the contribution documentation for this project.
  • [X] I agree to follow the code of conduct that this project uses.
  • [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.0.0-beta.58

Electron version

13.1.7

Operating system

Ubuntu 20.04/ubuntu-latest x64

Last known working Electron Forge version

None

Expected behavior

To be able to build flatpak

Actual behavior

I have 2 other makers before the flatpak maker: rpm and deb which run fine but the flatpak maker fails with the following error:

- Making for target: flatpak - On platform: linux - For arch: x64
✖ Making for target: flatpak - On platform: linux - For arch: x64

An unhandled error has occurred inside Forge:
An error occured while making for target: flatpak
flatpak failed with status code 1
Error: flatpak failed with status code 1
    at ChildProcess.<anonymous> (/home/runner/work/OTK-GUI/OTK-GUI/node_modules/@malept/flatpak-bundler/index.js:71:16)
    at ChildProcess.emit (events.js:400:28)
    at ChildProcess.emit (domain.js:475:12)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] make: `electron-forge make --arch=x64`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] make 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/2022-01-02T15_45_23_411Z-debug.log
Error: Process completed with exit code 1.

Steps to reproduce

Fork this repo and run the workflows again. Or simply check the logs for the latest workflow. (Build 6) https://github.com/Aditya-ds-1806/flatpak-test

Additional information

This is the flatpak portion of my build.yaml:

name: install flatpak-builder and eu-strip
      run: |
        sudo apt-get install flatpak -y
        sudo apt-get install flatpak-builder -y
        sudo apt-get install elfutils -y
        sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
        sudo flatpak install flathub org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08 -y

This is my forge.config.js:

{
  name: '@electron-forge/maker-flatpak',
  config: {
  options: {
    id: 'otk_gui',
    productName: 'otk_gui',
  }
}

Aditya-ds-1806 avatar Jan 03 '22 05:01 Aditya-ds-1806

I was able to build the flatpak by changing my workflow to this:

- name: install maker-flatpak dependencies
      run: |
        sudo apt-get install flatpak -y
        sudo apt-get install flatpak-builder -y
        sudo apt-get install elfutils -y
        sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
        sudo flatpak install flathub org.freedesktop.Platform/x86_64/19.08 org.freedesktop.Sdk/x86_64/19.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y

maker-flatpak attempts to download these dependencies when not found, but for some reason it is failing. As of now, a workaround is install them manually like shown above.

Aditya-ds-1806 avatar Jan 03 '22 06:01 Aditya-ds-1806

Hey @Aditya-ds-1806, thanks for reporting this issue! I'll take a look at the flatpak maker and see if we can figure out what's causing this.

VerteDinde avatar Jun 09 '22 18:06 VerteDinde