question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

afterAllArtifactBuild script fires before latest.yml is created

See original GitHub issue
  • Version: 21.0.1
  • Target: mac: dmg, zip; win: nsis

In the afterAllArtifactBuild script, latest.yml (and latest-mac.yml) are not created yet or are not saved to the output directory yet.

mac CI logs output from afterAllArtifactBuild: mac_output

windows CI logs output from afterAllArtifactBuild: windows_output

The arrays starting on line 167 and 92 respectfully are all the files in the outDir folder.

Note: BUILD TYPE trial is something specific to my app

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ArmelChesnaiscommented, Mar 22, 2022

Still relevant in 23.0.2. I’m trying to automate a modification to the yml file before it gets uploaded, and this is impossible directly with afterAllArtifactBuild, as the yml file doesn’t exist when afterAllArtifactBuild is called. The above solution by asd seems like a possible hack/workaround, but doesn’t seem like it should be the expected approach.

If afterAllArtifactBuild is meant to be used solely for the application artifacts and not the yml file, then a new hook along the lines of “beforeUpload” should be available.

1reaction
asd281533890commented, Aug 3, 2021

I solved this problem by using chokidar

// afterAllArtifactBuild.js
const chokidar = require('chokidar')
const fs = require('fs')
const path = require('path')
exports.default = async buildResult => {
  const filePath = path.join(buildResult.outDir, 'latest.yml')
  fs.access(filePath, fs.contants.R_OK, err => {
    const watcher = chokidar.watch(filePath)
    watcher.on(err ? 'add' : 'change', (event, path) => {
        // await do something
        watcher.unwatch(filePath)
        process.exit(0)
      })
  })
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron-builder does not create latest.yml for auto updates ...
I'm trying to generate the auto update files to upload to a server. After signing and notarizing I expect the latest.yml file to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found