Open cameronsutter opened 4 years ago
Similar issue? #4435
Maybe try to look at your folder when it's being built (try in your own PC, and then on CIs if it does change), or maybe it is already named like this.
(on mac, maybe try to chmod 777 the whole folder before renaming, idk)
@kzimny it's not quite similar because that one deals with when the app is trying to update. My issue is during build.
@ShadixAced that's a good idea. I'll give that a try and see what's happening on my local computer
I'm having the same issue here. It really looks like afterAllArtifactBuild is called before latest-mac.yml is created. Therefore is quite a pain to setup a deploy system in the afterAllArtifactBuild.
I'm using version 22.2.0
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Yes it is still relevant. latest-mac.yml (and alpha-mac.yml and beta-mac.yml if generateUpdatesFilesForAllChannels is set to true) is created after the event afterAllArtifactBuild
is fired. It would make sense to fire the afterAllArtifactBuild
event after all the files have been created.
Still relevant, because latest-mac.yml
is actually not generated when version is valid semver alpha and generateUpdatesFilesForAllChannels: true
.
If afterAllArtifactBuild
was predictable a hook could be used, that would check if latest-mac.yml
is generated, if not then create it by looking if there is beta-mac.yml
or alpha-mac.yml
and copy that as latest-mac.yml
.
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)
})
})
}
Still relevant in 23.0.0-alpha.3
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.
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) }) }) }
fs.constants.R_OK is right
any news on this? can't seem to make it work with chokidar.
I want to wait until latest.yml is created so I can return more items in the array for this afterAllArtifactBuild
method
In the afterAllArtifactBuild script,
latest.yml
(andlatest-mac.yml
) are not created yet or are not saved to the output directory yet.mac CI logs output from afterAllArtifactBuild:
windows CI logs output from afterAllArtifactBuild:
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