Skip to content

Instantly share code, notes, and snippets.

@PancakeTAS
Created January 18, 2024 10:27
Show Gist options
  • Save PancakeTAS/e434a718a0c26dcbc520ad35f842eeb8 to your computer and use it in GitHub Desktop.
Save PancakeTAS/e434a718a0c26dcbc520ad35f842eeb8 to your computer and use it in GitHub Desktop.

If you want to give players the ability to download the newest and freshest release of your mod, you're gonna wanna set up this build ci script. Paste the script below into .github/workflows and create a spplice manifest in /. A example for a manifest.json is attached as well.

There's not a lot to configure. Here's what you can change:

  1. change on: [push] to on: [push, pull_request] if you want the script to run when a pull request is created.
  2. add submodules: true to the with: block in the step "Checkout repository", if you have added submodules to your project
  3. expand the excluded files using --exclude <wildcard> in the step "Create inner archive", if you have any more files you don't want to pack into the final spplice package (such as README.md and LICENSE.md)
{
"title": "Your mod name",
"name": "yourmodid",
"author": "You!",
"description": "This is where you put a so called \"description\" of your mod",
"weight": 100,
"icon": "data:image/png;base64,yourmodslogoshouldbe854by480andencodedasbase64"
}
name: Spplice Package
on: [push]
jobs:
package:
runs-on: ubuntu-latest
steps:
# checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
path: repo
- name: Parse package name
id: parse
run: echo "name=$(jq -r '.name' repo/manifest.json)" >> "$GITHUB_OUTPUT"
# create archives
- name: Create inner archive
run: tar -cJf ${{ steps.parse.outputs.name }}.tar.xz --exclude='.[^/]*' --exclude=manifest.json -C repo .
- name: Create outer archive
run: tar -cf ${{ steps.parse.outputs.name }}.sppkg ${{ steps.parse.outputs.name }}.tar.xz -C repo manifest.json
# publish artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Spplice Package (unzip first)
path: ${{ steps.parse.outputs.name }}.sppkg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment