Giter VIP home page Giter VIP logo

upload-to-modio's Introduction

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/[email protected]
        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/[email protected]
        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

upload-to-modio's People

Contributors

dependabot[bot] avatar nickelc avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.