Git Product home page Git Product logo

curseforge-upload's People

Contributors

dependabot[bot] avatar itsmeow avatar notmyfault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

curseforge-upload's Issues

How to upload "Additional files"?

I use this to publish my modpack automatically.
I release zip for for servers too. I need to upload that zip file as an "additional file". Is there a way to do that?

Invalid game version ID: The game version ID: 9016 belongs to an invalid dependency

Is this curseforge api being bad, or is there some bug with version name -> id mapping? (or did we do something incorrectly?)

The workflow passed 1.18.2 to the action, seems like it was translated to that id then curseforge rejected it.

{"errorCode":1009,"errorMessage":"Invalid game version ID: 9016 belongs to an invalid dependency."}

This is the run that triggered it with all the inputs: https://github.com/gnembon/fabric-carpet/runs/5683187727?check_suite_focus=true (in the little arrow at line 1)

Support numeric gameVersionTypeId

Request

Allow specifying a numeric gameVersionTypeId instead of performing a lookup via the version-types endpoint.
Ex: Java:Java 18 -> 2:Java 18

Why?

Due to how messy CF's API is it's hard to say that this would even work as expected - the existing request somehow has worked for me even though it probably shouldn't.

The bukkit endpoint exists but is basically empty. All actual Bukkit versions are available via the minecraft endpoint instead. The API's version-types (https://minecraft.curseforge.com/api/game/version-types?token=<your token>) does not yield Bukkit at all, but Bukkit's version ID is 1. This can be confirmed by viewing source for Bukkit/CF pages.

Project on Curseforge's file:

<p class="text-gray-500 font-bold mb-2">Supported Bukkit Versions</p>
<div class="form-controls convert-list" id="field-game-version-1">
<li class="list-none field-choice field-choice-radio form-game-version-container form-game-version-container-1-18-2">
<label for="field-game-version-1-1.18.2">
<input type="checkbox" name="ff58f8aa7e8f8368fe36153765e3f1cd7" value="9016" checked="checked" id="field-game-version-1-1.18.2" class="form-game-version-container form-game-version-container-1-18-2" />
<span>
1.18.2
</span>
</label>
</li>
<li class="list-none field-choice field-choice-radio form-game-version-container form-game-version-container-1-18-1">
<label for="field-game-version-1-1.18.1">
<input type="checkbox" name="ff58f8aa7e8f8368fe36153765e3f1cd7" value="8897" id="field-game-version-1-1.18.1" class="form-game-version-container form-game-version-container-1-18-1" />
<span>
1.18.1
</span>
</label>
</li>
...

Same project on devbukkit:

               <section class="e-game-versions">
                    <h3>Supported Bukkit Versions</h3>
                    
    <!-- Field -->
       
   
<ul class="covert-list checkbox form-game-version-container form-field-model-multiple-choice-field`1" id="field-game-version-1">

       
    <li class="field-choice field-choice-radio form-game-version-container form-game-version-container-1-18-2">
        <label for="field-game-version-1-1-18-2">
            <input type="checkbox" 
                name="fe93305e74d3d1a5a6380ebcbd3b70383"                
                value="9016"
                
                id="field-game-version-1-1-18-2" 
                class="form-game-version-container form-game-version-container-1-18-2" />           
                <span>
                    1.18.2
                </span>
            </label>
        
    </li>

       
    <li class="field-choice field-choice-radio form-game-version-container form-game-version-container-1-18-1">
        <label for="field-game-version-1-1-18-1">
            <input type="checkbox" 
                name="fe93305e74d3d1a5a6380ebcbd3b70383"                
                value="8897"
                
                id="field-game-version-1-1-18-1" 
                class="form-game-version-container form-game-version-container-1-18-1" />           
                <span>
                    1.18.1
                </span>
            </label>
        
    </li>
    ...

From https://minecraft.curseforge.com/api/game/versions?token=<your token>:

{
  "id": 9016,
  "gameVersionTypeID": 1,
  "name": "1.18.2",
  "slug": "1-18-2"
},
...

It's pretty clear both from the base list and the actual entries' data that the game ID is 1. However, as Bukkit does not exist in the version-types output, I cannot specify Bukkit:1.18.2 when using the action to guarantee that ID 9016 will be selected. I don't believe including a hardcoded list of additional game IDs is a good idea, so I want to be able to instead use 1:1.18.2 and have it yield the same result that Bukkit:1.18.2 would if CF actually had Bukkit in the version types list.

Don't bump major with dependency updates

Bumping major (v2->v3) for dependency updates basically makes everyone that isn't targeting latest commit to get outdated versions of the action. Since Github recommends (and suggests the code for in the marketplace) tagging the release with a major in the action workflow, that's most of the users.

AFAIK, Github follows semver, which basically means that you should only bump major in case there are are "backwards-incompatible changes", like changing required arguments, etc. Other changes (dep updates, fixes, small additions that don't break old workflows, etc) shouldn't bump major, but either minor or patch.

Don't worry about the v3 now, that one is already released, but please don't do it for the next versions, imagine the deps update include security issues or something more important, you would be letting users out.

Thanks!

You can close this.

TypeError: Cannot read properties of undefined (reading 'id')

Description

In case of an invalid typeId, the filter at

let result = versionTypeData.filter(
(v) => v.name == typeId || v.slug == typeId
);

returns an empty list. This empty list is not checked and therefore throws TypeError: Cannot read properties of undefined (reading 'id') at
"Converted version type " + typeId + " to " + result[0].id

Steps to reproduce

Use the invalid:1.18.2 for game_versions property.

Expected output

A meaning full error telling me I used invalid typeId and exit gracefully.

Actual output

TypeError crash

Get output fileID of CurseForge to append to URL

When a file/mod is uploaded to CF, it'll be displayed under the following URL:
https://www.curseforge.com/minecraft/mc-mods/notfmcplease/files/3531003

That last part: 3531003 is something i would want to append to a message i post on discord like:

messagefordiscord: Hey you can download the file at: https://www.curseforge.com/minecraft/mc-mods/notfmcplease/files/${{ thatfile_id }}

I'm pretty sure you've already included this at: https://github.com/itsmeow/curseforge-upload/blob/master/action.yml#L38
But i'm not sure what the name of that variable is :P

please allow a way for the file to be renamed before upload

i would like an optional parameter which allows you to change the name of the .jar before upload,
e.g

with:
token: ${{ secrets.CF_API_KEY }}
project_id: ID
game_endpoint: minecraft
file_path: build/libs/modid-1.0.jar
rename-file: mod.jar
changelog: updated mod, changelog on github
display_name: mod
game_versions: 1.15.2,Java 8,Forge
release_type: alpha

it will upload the exact thing of modid-1.0.jar, but will rename it to jarm.jar and upload the renamed file

TypeError: Cannot read properties of undefined (reading 'body')

##[debug]Request meta: {"changelog":"### [1.12.1](https://github.com/Wynntils/Wynntils/compare/v1.12.0...v1.12.1) (2022-09-09)\n\n\n### Bug Fixes\n\n* **test:** test release ([6a8d4bd](https://github.com/Wynntils/Wynntils/commit/6a8d4bdf1c552401448443be64af8a2d1749add7))","gameVersions":[6756,8867,4458],"releaseType":"beta","changelogType":"markdown","displayName":"Wynntils-v1.12.1"}
/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:11402
          `Request error:${err}\nResponse body:\n${response.body}\nRequest body:${body}`
                                                            ^

TypeError: Cannot read properties of undefined (reading 'body')
    at Request._callback (/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:11402:61)
    at self.callback (/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:[127](https://github.com/Wynntils/Wynntils/runs/8270267496?check_suite_focus=true#step:3:128)55:22)
    at Request.emit (node:events:390:28)
    at FormData.<anonymous> (/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:13824:10)
    at FormData.emit (node:events:402:35)
    at FormData.module.exports.547.CombinedStream._emitError (/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:16414:8)
    at DelayedStream.<anonymous> (/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:16340:10)
    at DelayedStream.emit (node:events:402:35)
    at DelayedStream.module.exports.152.DelayedStream._handleEmit (/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:1925:15)
    at ReadStream.source.emit (/home/runner/work/_actions/itsmeow/curseforge-upload/v3/dist/index.js:1872:19)

After sending the request manually, this was the response from curseforge:

Status Code: 400
Response:

{
	"errorCode": 1009,
	"errorMessage": "Invalid game version ID: 8867 belongs to an invalid dependency."
}

I have added the correct ID but thought I should report that the error was not caught properly.

Alternative way to get version IDs

When you are uploading/editing a file in CurseForge, there are several checkboxes to select the versions.
After using the browser inspect tool, I discovered that each checkbox has an attribute named "value", which corresponds to the game version ID.

image

CurseForge API is returning 400: Bad Request

Sorry to open an issue - I'm aware this is not a problem of curseforge-upload, but I'm hoping to find out what the reason might be (seeing as that the API returns no error information).

This workflow file at this step leads to the error.

image

Manually uploading the same file with the same settings via the CurseForge website works.

Interestingly, this very similar workflow file at the same step, works without issue as well.

image

Any ideas on what might be going wrong, or how to find out, would be appreciated.

Thank you!

Input file_path accept first found .jar in folder path

It would be handy if the file_path input would, if given only a path, to get the first occurrence of a .jar.
This way, people don't have to make an extra step to refer to the exact jar they want to upload.
If multiple .jar's are found, throw an warning but get the first occurrence.

You think this is a good idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.