Skip to content

nickelc/upload-to-modio

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mod.io

📦🕹️ GitHub Action for uploading mods to mod.io

Name: nickelc/upload-to-modio

Requires: curl v7.76+ (It will be installed from Ubuntu Snap Store for Ubuntu 20.04)

Usage

on: push

jobs:
  build:
    runs-on: ubuntu-22.04

    steps:
      - name: Build mod file
        run: |
          echo "Hello Mod" > mod.txt
          zip modfile.zip mod.txt

      - uses: nickelc/upload-to-modio@v2.1.0
        with:
          token: ${{ secrets.MODIO_TOKEN }}
          game: 206
          mod: 1041
          path: modfile.zip

Extract metadata for the upload

Using the jq command to extract game id, mod id and version from a json file.

on: push

jobs:
  build:
    runs-on: ubuntu-22.04

    steps:
      - name: Build mod file
        run: |
          echo "Hello Mod" > mod.txt
          zip modfile.zip mod.txt

      - name: Extract metadata
        id: metadata
        run: |
          GAME_ID=$(jq '.game' metadata.json)
          MOD_ID=$(jq '.mod' metadata.json)
          VERSION=$(jq '.version' metadata.json)

          echo "GAME=$GAME_ID" >> $GITHUB_OUTPUT
          echo "MOD=$MOD_ID" >> $GITHUB_OUTPUT
          echo "VERSION=$VERSION_ID" >> $GITHUB_OUTPUT

      - uses: nickelc/upload-to-modio@v2.1.0
        with:
          token: ${{ secrets.MODIO_TOKEN }}
          game: ${{ steps.metadata.outputs.GAME }}
          mod: ${{ steps.metadata.outputs.MOD }}
          version: ${{ steps.metadata.outputs.VERSION }}
          path: modfile.zip

Inputs

Required parameters

Name Type Description
token String The user's access token
game Number Unique id of the game
mod Number Unique id of the mod
path String Path to the file to upload

Optional parameters

Name Type Description
test-env Boolean Use the test environment
version String Version for the file
changelog String Changelog for the file
changelog-path String Path to the changelog of the file
active Boolean Label this upload as the current release
filehash String MD5 hash of the file
metadata String Metadata blob of the file
metadata-path String Path to the metadata blob of the file
platforms String Comma-separated list of platforms: Windows,Linux

See https://docs.mod.io/#targeting-a-platform for supported platform values.

Outputs

Name Type Description
id Number Unique id of the uploaded file
url String Download URL for the file
filehash String MD5 hash for the uploaded file
response String File to response content of the request