Open neil-morrison44 opened 2 years ago
2 & 3. You're definitely right about this one. even though i kinda don't like the idea of doing anything just zipping up and hosting jotego's stuff as is, most people are gonna wanna update those json files anyway so might as well just automate it for them. maybe we can build 2 copies of each, a untouched one and another with our tweaks to the platform and images?
Yeah, date's probably fine, but Pocket Sync will need it duplicated into the version
field (eventually) for it to show that there's an update (since it compares what the core has locally to what the inventory says is the latest version in the new version
param)
The only thing with date is it prevents 2 versions being released in a single day, which doesn't seem to be a problem with MiSTer but I've seen a few hot fixes go out for Pocket things.
& yeah, I also have mixed feelings on adjusting the files beyond what's necessary
We can try and reach out to see about the version field / jsons / get blessing on doing this semi-officially somewhere
yeah good point about multiple releases on the same day. jotego's cores straight up have the string "noversion" set as their version, so i guess we could maintain our own semver that we just increment? i dont know, that feels like it could get confusing though
Semver's just a recommendation in the Pocket docs - I think using the git hash of the most recently updated file going into the zip is probably safest, and we wouldn't have to worry about maintaining it (after a bit of faff involved in writing a script to look it up)
yeah now that i think about it again, you're right thats probably the easiest/simplest
i think we can use the commits end point on the github api and just pass it each path
we wanna check for the latest commit inside of (Assets/{platform}, Cores/{identifier}, etc) to see if any files that would be zipped up into a core's release were changed later than the last commit hash we saved
https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits-on-a-repository
Yeah that'd work - risk of running into rate limiting though.
If you pass depth: 0
to the checkout action then it pulls the entire git tree down and you can do some git log
s etc locally (might be fine with the default depth too, not sure)
i THINK you can pass it a path to a directory, and it will just give you the latest commit hash from any file within that tree. you dont need to hit the api for every individual file not sure though, would have to test and i havent actually done anything yet haha
so basically 4 calls per core. pretty sure the rate limit with a token is 1000/hour
Been playing with this for the last few days, it's scarily good when it's not outright lying
lol ive been playing with that a bunch too, its extremely impressive. i should have thought to try that for this haha
ok so if i have this update the core.json of each core and put the hash in as the version and then build each zip named corename_{hash}.zip
would that cover what you'd need?
That covers it core wise - the inventory json will need to have the new version
param too where it says what the latest core self-reports as the version (but we’ll get that once it’s in the inventory proper) since that’s what Pocket Sync checks the local version against
alright I pulled the trigger and merged this into the main branch. so this should be running daily to check the jtbin repo for new commits in each core directory and if it finds a new one, rezips up the entire thing and writes the hash into core.json as the version before naming the zip {core name}_{hash}.zip and deleting the previous one so there's only the latest build of each. since the inventory isn't including these yet I just have a json file I'm hosting on my updater repo that mimics the api response, but for these cores, as a temp solution to get support for them. so I can let my app be the guinea pig (but feel free to pull that json down with pocket sync too obviously) then we could work on adding any extra features here like updating the platform names or whatever
Hey, just going to sketch out a couple of ideas of what we could do here, roughly in order from "we probably should do it" through to "Hmmm, that's a grey area":
Using something as the version flag
"Better" platform JSON files, with the full names, original manufacturer, year etc
jt*
by default in the list -- the author tag etc wouldn't change thoughPS1
->PSX
for something similar I think"Better" platform.bin images
JT
(though, some of the cores don't have images at all just now)