Kir-Antipov / mc-publish

šŸš€ Your one-stop GitHub Action for seamless Minecraft project publication across various platforms.
MIT License
216 stars 19 forks source link

ArgumentError: At least one game version should be specified to upload files to CurseForge #116

Closed AdamRaichu closed 2 months ago

AdamRaichu commented 2 months ago

Description

I'm trying to use mcpublish to upload builds of my mods to CF and MR. I was able to use this successfully several times about 2 months ago. However, when I tried to use this recently (started about 2 days ago), the workflow failed with the following error.

ArgumentError: At least one game version should be specified to upload files to CurseForge. (Parameter 'request.gameVersions')

I tried to fix this by adding (it wasn't needed before) the game-versions input, and several variations on it, but still get the same error.

You can see my workflow runs here, which have all of the workflow files and value logged.

Expected Behavior

The workflow should upload files to CF.

Actual Behavior

The workflow shows the following in the logs.

šŸ“¤ Uploading assets to CurseForge
Error: ArgumentError: At least one game version should be specified to upload files to CurseForge. (Parameter 'request.gameVersions')

Version

uses: Kir-Antipov/mc-publish@v3.3

Environment

GitHub Actions

Configuration

# I've tried variations of this. Again, see the link I posted earlier to see other workflow file attempts. The env variables do exist according to the log.

      - name: Publich to Modrinth and CurseForge
        uses: Kir-Antipov/mc-publish@v3.3
        with:
          modrinth-id: fK1LHuQH
          modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
          modrinth-version: "${{ env.mod_version }}.${{ env.minecraft_version }}"

          curseforge-id: 971238
          curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

          github-tag: v${{ env.mod_version }}-${{ env.minecraft_version }}
          github-token: ${{ secrets.GITHUB_TOKEN }}

          name: "[Fabric ${{env.minecraft_version}}] ${{env.mod_version}}"
          version: ${{ env.mod_version }}
          version-type: release
          game-versions: |
            1.20.5-snapshot
          loaders: fabric
          changelog: ${{ inputs.changes}}

Logs

Run Kir-Antipov/mc-publish@v3.3
  with:
    modrinth-id: fK1LHuQH
    modrinth-token: ***
    modrinth-version: 2.2.1.1.20.5-rc2
    curseforge-id: 971238
    curseforge-token: ***
    github-tag: v2.2.1-1.20.5-rc2
    github-token: ***
    name: [Fabric 1.20.5-rc2] 2.2.1
    version: 2.2.1
    version-type: release
    game-versions: 1.20.5-snapshot

    loaders: fabric
    changelog: Support 1.20.5 (release candidate only). Also fix the label of Portal Linking Compass not showing in Icon Style settings.
    modrinth-featured: ${undefined}
    modrinth-unfeature-mode: subset
    github-generate-changelog: ${undefined}
    github-draft: ${undefined}
    github-prerelease: ${undefined}
    github-commitish: ${undefined}
    github-discussion: ${undefined}
    files: build/libs/!(*-@(dev|sources|javadoc)).jar
  build/libs/*-@(dev|sources|javadoc).jar

    files-primary: ${undefined}
    files-secondary: ${undefined}
    changelog-file: ${undefined}
    dependencies: ${undefined}
    version-resolver: ${undefined}
    game-version-filter: releases
    java: ${undefined}
    retry-attempts: 2
    retry-delay: 10000
    fail-mode: fail
    # [undefined inputs below this point removed from log by me]
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Microsoft_jdk/21.0.2/x64
    JAVA_HOME_21_X64: /opt/hostedtoolcache/Java_Microsoft_jdk/21.0.2/x64
    mod_version: 2.2.1
    minecraft_version: 1.20.5-rc2
šŸ“¤ Uploading assets to CurseForge
Error: ArgumentError: At least one game version should be specified to upload files to CurseForge. (Parameter 'request.gameVersions')

Other Information

No response

Kir-Antipov commented 2 months ago

Hi! This isn't actually an issue with mc-publish! Here are all your failed runs (from oldest to newest):

I see that you've since changed Minecraft's version in fabric.mod.json to >1.20.4, and considering that Mojang has just released 1.20.5, please revert everything you did to your otherwise perfectly fine workflow file, and it will work just fine! :)

AdamRaichu commented 2 months ago

Thanks, I see now the answer was staring me in the face. Thank you for the detailed explanation.

Kir-Antipov commented 2 months ago

You are always welcome! If you do decide to showcase pre-release versions of Minecraft on your project's page on CurseForge/Modrinth, you can simply change the default filter value to:

game-version-filter: any

Also, just keep in mind in the future that you cannot publish a mod that supports an unreleased version of Minecraft, because it has yet to be listed on Modrinth/CF :D