Giter Club home page Giter Club logo

modrinth-upload's Introduction

Modrinth Uploader

An action for interacting with the Modrinth file upload API

Usage/Arguments

Name Description Default Value Required
token Token used to authenticate with Modrinth API. Use a repository secret for this N/A
file_path The path to the file you want to upload N/A
name The display name for this file N/A
version The version number. Ideally will follow semantic versioning N/A
changelog The change log for this version
relations List of projects this file is related to and their relation type. Separate with ,. Format: projectId:relationType - Valid relationTypes are: required, optional, incompatible and embedded
game_versions The game versions to select on this file. Separate with , N/A
release_type The type of this release. Allowed values: alpha, beta, release release
loaders The mod loaders that this version supports. Separate with , N/A
featured Whether the version is featured or not N/A
project_id Project ID to upload file to. You can get the ID from the sidebar on a project page under "Technical Information" N/A
staging Whether to use Modrinth's staging api false
new_project_body A new body for the mod page

Example Workflow

name: "Build and Publish"
on:
  release:
    types: [published]
jobs:
  build-and-publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set up JDK 17
        uses: actions/setup-java@v2
        with:
          distribution: 'temurin'
          java-version: 17
          cache: 'gradle'

      - name: Build with Gradle
        id: build,
        run: chmod +x gradlew && ./gradlew build

      - name: Find correct JAR
        id: findjar
        run: |
          output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
          echo "jarname=$output" >> $GITHUB_OUTPUT

      - name: Upload to the GitHub release
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ github.event.release.upload_url }}
          asset_path: build/libs/${{ steps.findjar.outputs.jarname }}
          asset_name: ${{ steps.findjar.outputs.jarname }}
          asset_content_type: application/java-archive

      - name: Upload to Modrinth
        uses: RubixDev/modrinth-upload@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          file_path: build/libs/${{ steps.findjar.outputs.jarname }}
          name: My super cool mod ${{ github.event.release.tag_name }}
          version: ${{ github.event.release.tag_name }}
          changelog: ${{ github.event.release.body }}
          relations: P7dR8mSH:required
          game_versions: 1.19,1.19.1,1.19.2
          release_type: beta
          loaders: fabric,forge
          featured: true
          project_id: abcDEFGH

modrinth-upload's People

Contributors

8miyile avatar dependabot[bot] avatar itsmeow avatar rubixdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

8miyile

modrinth-upload's Issues

Update the version metadata if it already exists

It would be great if there was an option, to change the version metadata instead, when a version with the same version number already exists.

(Also, it would be nice if file_path was optional, and the action would fail if file_path wasn’t provided, but a version with the same version number doesn’t already exist.)

Unfeature old versions?

I don't suppose this action has a way to automatically unfeature old versions of the mod?

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.