Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

[Feature] Automate Remesh Package zip timestamp #94

Open
ItsSim opened this issue Jul 27, 2024 · 2 comments
Open

[Feature] Automate Remesh Package zip timestamp #94

ItsSim opened this issue Jul 27, 2024 · 2 comments
Labels
enhancement New feature or request feature accepted Feature has been accepted good first issue Good for newcomers help wanted Extra attention is needed low priority Low priority

Comments

@ItsSim
Copy link
Owner

ItsSim commented Jul 27, 2024

Is your feature request related to a problem? Please describe.
The remesh package needs the last modification timestamp in its file name in releases (e.g.: remeshes-1.0.0-1717947681.zip) for the launcher to check that it's been updated.

It currently requires editing the timestamp.txt https://github.com/ItsSim/fsolauncher/blob/develop/extras/fsolauncher-remeshes/timestamp.txt with the desired timestamp. Then GitHub Actions reads this file and creates the remesh .zip with the timestamp in the filename.

I tried changing the GitHub CI .yml to automatically add the timestamp of the last commit made to the remeshes folder in https://github.com/ItsSim/fsolauncher/tree/develop/extras/fsolauncher-remeshes/remeshes, but it didn't work because it seemed to always return the current date (so the remesh package would always have a new timestamp). Lost the code for this so I can't post it here for reference.

Describe the solution you'd like
A way to automatically set the last modification timestamp to the remesh .zip file. Should ideally be whenever the remeshes folder was last updated.

Describe alternatives you've considered
Alternative would be to just leave it as is, but would be a nice enhancement to figure this out.

Additional context
Add any other context or screenshots about the feature request here.

@ItsSim ItsSim added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers low priority Low priority feature accepted Feature has been accepted labels Jul 27, 2024
@tomgrice
Copy link
Contributor

Been a while since I have done anything in GitHub Actions.
Can you write a script to fetch https://api.github.com/repos/itssim/fsolauncher/commits?path=extras%2Ffsolauncher-remeshes&page=1&per_page=1 - using cURL?
object.commit.committer.date is the last commit date, then just a case of converting that to unix time?

@ItsSim
Copy link
Owner Author

ItsSim commented Aug 26, 2024

Been a while since I have done anything in GitHub Actions. Can you write a script to fetch api.github.com/repos/itssim/fsolauncher/commits?path=extras/fsolauncher-remeshes&page=1&per_page=1 - using cURL? object.commit.committer.date is the last commit date, then just a case of converting that to unix time?

That seems like it would work, didn't know about this part of the GitHub API.

Since the GitHub Action runs the build.js in fsolauncher-remeshes https://github.com/ItsSim/fsolauncher/blob/develop/extras/fsolauncher-remeshes/build.js
and currently just reads from timestamp.txt, would be a matter of just changing that to read from that API, perhaps using the API token in the request, that can be exposed as a node.js environment variable when running in the GitHub Action

GITHUB_RATELIMIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feature accepted Feature has been accepted good first issue Good for newcomers help wanted Extra attention is needed low priority Low priority
Projects
None yet
Development

No branches or pull requests

2 participants