Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Modrinth Shaders #52

Open
null511 opened this issue Mar 2, 2023 · 4 comments
Open

Support for Modrinth Shaders #52

null511 opened this issue Mar 2, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@null511
Copy link

null511 commented Mar 2, 2023

I'm unable to push shaders to Modrinth; it seems to require a "loaders" field, which doesn't really apply - but even when it's set (as per example) it complains on push [bad request] that the value is invalid.

@Kir-Antipov
Copy link
Owner

Kir-Antipov commented Mar 2, 2023

Would be nice to hear a little bit more details:

  • Which type of shaders are you trying to publish? (I.e., Optifine, Iris, or Canvas)
  • How does your current configuration look like?

@null511
Copy link
Author

null511 commented Mar 2, 2023

https://github.com/Null-MC/Shrimple/blob/main/.github/workflows/Release.yml

My projects are for Optifine and/or Iris only. I tried changing the 'loader' field to use these values, since that's what the web GUI shows as options for that field when uploading shaders.

Error: Failed to upload file: 400 (Bad Request, {"error":"invalid_input","description":"Invalid loader: Optifine"})

I also disabled the CurseForge publish using this action, since it complains about mismatches between the game-version & CF's game ID's.

Error: Failed to upload file: 400 (Bad Request, {"errorCode":1009,"errorMessage":"Invalid game version ID: 7499 belongs to an invalid dependency."})

@null511
Copy link
Author

null511 commented Mar 3, 2023

It's actually working now; not sure if you fixed something, or if it was simply changing the loader options to be lowercase (swear I tested that yesterday too)

@Kir-Antipov
Copy link
Owner

So, let's start with a note that there's no official support for plugins, shaders, resource packs, and so on yet, which means that mc-publish cannot automagically resolve some required values, but it's still possible for you to provide those manually and effectively use mc-publish as a wrapper over the Labrinth API and CurseForge Upload API. That said, in such cases, you need to know what these APIs require from you.


Now, let's focus on Modrinth. As you can see, their createVersion method requires the loaders parameter to be provided. In order to understand what exactly we need to specify for loaders, we can call the loaderList method and inspect values it returns. From that we can learn that there are four loaders which support shader project type: iris, canvas, vanilla, and optifine. Therefore, your configuration should look like this:

loaders: |
  iris
  optifine

The error you got earlier:

Error: Failed to upload file: 400 (Bad Request, {"error":"invalid_input","description":"Invalid loader: Optifine"})

was caused by the fact that you used capitalized variants of the loaders you wanted, which are not valid from Modrinth's point of view.


Moving on to CurseForge, it does not require any loaders to be specified for your project type, nor it can differentiate between different shader mods at all (because of course it can't). So, you can fill the loaders field with the same values as for Modrinth, and it won't make a difference.

The error you got:

Error: Failed to upload file: 400 (Bad Request, {"errorCode":1009,"errorMessage":"Invalid game version ID: 7499 belongs to an invalid dependency."})

was caused by the fact that you specified fabric as a loader, which is not supported for your project type.


Taking all of the above into consideration, your current configuration:

name: Shrimple v${{ github.event.inputs.version }}
version: v${{ github.event.inputs.version }}
version-type: beta
files: ./Shrimple_v${{ github.event.inputs.version }}.zip
changelog: "###Release ${{ github.event.inputs.version }}"
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-id: BS9T99lD
curseforge-token: ${{ secrets.CF_API_TOKEN }}
curseforge-id: 832754
loaders: |
  optifine
  iris
game-versions: |
  1.19.3
  1.19.2
  1.19.1
  1.19

should work even with the "curseforge" part uncommented.


I'm going to leave these issues open until I implement full support for shader projects.
(If you want to help speed up the process, you can make a PR like #32.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants