samuelmeuli / action-electron-builder

:electron: GitHub Action for building and releasing Electron apps
MIT License
658 stars 201 forks source link

Action not publishing release #74

Open ramonbroox opened 2 years ago

ramonbroox commented 2 years ago

Using the README action:

name: Build/release

on: 
  push:
    branches:
    - master

jobs:
  release:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    strategy:
      matrix:
        os: [macos-10.15, ubuntu-18.04, windows-latest]

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

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v2.4.1
        with:
          node-version: '>=16.8.0'

      - 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') }}

and tagging and pushing, no release is created. Log shows:

 • skipped publishing  file=latest-mac.yml reason=release doesn't exist and not created because "publish" is not "always" and build is not on tag tag=v2.5.4 version=2.5.4
abdulghanitech commented 2 years ago

I'm facing the same issue, does anyone how to solve this problem?

ramonbroox commented 2 years ago

We were using a native extension (serialport) which caused the build to fail. We replaced the requiring package and voilá, it built.

Thyssenkrupp234 commented 2 years ago

Having this issue too. @ramonbroox, what package did you replace

ramonbroox commented 2 years ago

Having this issue too. @ramonbroox, what package did you replace

One osc-something npm package. Check your package-lock.json for the serialport dependency. Also, any native package that requires compilation might be involved.

princemdavi commented 2 years ago

i cannot understand what you replaced

fmaclen commented 2 years ago

I was having the same issue but fixed it by pointing to the latest version of the action (as opposed to v1):

- name: Build/release Electron app
  uses: samuelmeuli/action-electron-builder@v1.6.0
sators commented 2 years ago

I'm having this difficulty as well - my yaml is set to the following config:

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

The build output shows:

$ <omitted>/node_modules/.bin/electron-builder --mac --publish always
  • electron-builder  version=22.11.7 os=20.6.0
  • loaded configuration  file=package.json ("build" field)
  • packaging       platform=darwin arch=x64 electron=13.1.7 appOutDir=dist/mac
  • downloading     url=https://github.com/electron/electron/releases/download/v13.1.7/electron-v13.1.7-darwin-x64.zip size=79 MB parts=6
  • downloaded      url=https://github.com/electron/electron/releases/download/v13.1.7/electron-v13.1.7-darwin-x64.zip duration=1.247s
  • default Electron icon is used  reason=application icon is not set
  • 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=macOS zip arch=x64 file=dist/<omitted>-0.0.1-mac.zip
  • building        target=DMG arch=x64 file=dist/<omitted>-0.0.1.dmg
  • building block map  blockMapFile=dist/<omitted>-0.0.1.dmg.blockmap
  • building embedded block map  file=dist/<omitted>-0.0.1-mac.zip
Done in 114.64s.

The builds run successfully, but there are no releases that are created in the Github repository...the same happens for osx and windows...what am I missing?

daltonmenezes commented 2 years ago

@sators it will generate a draft release at releases page, you need to edit this draft and publish it manually. I made an Electron boilerplate with everything configured, you can check it and also check the releasing section, it shows in video this part of the draft release.

sators commented 2 years ago

Thank you @daltonmenezes for the swift response and links. I have looked through all of those and my config seems to match, however, I don't end up with a draft release - my releases page shows There aren’t any releases here. 🤔

Does the action-electron-builder output have any log messages when a release is successfully created? I was seeing output at the end of the build if it was explicitly not releasing due to a tag not matching...but with release: true set on the action config...I'm not seeing any draft and the action completes successfully...

daltonmenezes commented 2 years ago

@sators probably the action is running, but the new tag is not being detected and not triggering the draft release creation. 🤔

daltonmenezes commented 2 years ago

@sators here's how I made the release:

  1. Updating the package json version
  2. Performing:
    git commit -am v1.0.1
    git tag v1.0.1
    git push
    git push --tags

    I made automation for this process by creating this CLI helper for the boileplate

heliomarpm commented 1 year ago

@sators aqui está como eu fiz o lançamento:

  1. Atualizando a versão do pacote json
  2. Executar: ```js git commit -am v1.0.1 git tag v1.0.1 git push git push --tags

Fiz automação para este processo criando este auxiliar CLI para a boileplate

great job

heliomarpm commented 1 year ago

I'm having this difficulty as well - my yaml is set to the following config:

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

The build output shows:

$ <omitted>/node_modules/.bin/electron-builder --mac --publish always
  • electron-builder  version=22.11.7 os=20.6.0
  • loaded configuration  file=package.json ("build" field)
  • packaging       platform=darwin arch=x64 electron=13.1.7 appOutDir=dist/mac
  • downloading     url=https://github.com/electron/electron/releases/download/v13.1.7/electron-v13.1.7-darwin-x64.zip size=79 MB parts=6
  • downloaded      url=https://github.com/electron/electron/releases/download/v13.1.7/electron-v13.1.7-darwin-x64.zip duration=1.247s
  • default Electron icon is used  reason=application icon is not set
  • 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=macOS zip arch=x64 file=dist/<omitted>-0.0.1-mac.zip
  • building        target=DMG arch=x64 file=dist/<omitted>-0.0.1.dmg
  • building block map  blockMapFile=dist/<omitted>-0.0.1.dmg.blockmap
  • building embedded block map  file=dist/<omitted>-0.0.1-mac.zip
Done in 114.64s.

The builds run successfully, but there are no releases that are created in the Github repository...the same happens for osx and windows...what am I missing?

I have the same behavior. Managed to solve?

sators commented 1 year ago

I was not pushing tags to the origin - See @daltonmenezes answer https://github.com/samuelmeuli/action-electron-builder/issues/74#issuecomment-1114266551

heliomarpm commented 1 year ago

Using the README action:

name: Build/release

on: 
  push:
    branches:
    - master

jobs:
  release:
    runs-on: ${{ matrix.os }}
    timeout-minutes: 20
    strategy:
      matrix:
        os: [macos-10.15, ubuntu-18.04, windows-latest]

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

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v2.4.1
        with:
          node-version: '>=16.8.0'

      - 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') }}

and tagging and pushing, no release is created. Log shows:

 • skipped publishing  file=latest-mac.yml reason=release doesn't exist and not created because "publish" is not "always" and build is not on tag tag=v2.5.4 version=2.5.4

Anyone who is still having this problem, in my case I solved it by giving write permission.

  name: Publish
  on:
    push:
      tags: ["*"]

  jobs:
    publish:
      if: startsWith(github.ref, 'refs/tags/v')
      runs-on: ${{ matrix.os }}
      permissions:
        contents: write
      ...

Ex. https://github.com/heliomarpm/electron-quick-start/blob/master/.github/workflows/publish.yml

aniyd commented 1 year ago

pass the args as --publish=always and it will work

heliomarpm commented 1 year ago

pass the args as --publish-always and it will work

Thanks