mirror of
https://github.com/darksaid98/optim.git
synced 2026-12-01 22:16:40 +00:00
135 lines
4.3 KiB
YAML
135 lines
4.3 KiB
YAML
name: 'Release Modpack From A Release | Action'
|
|
description: 'This automatically downloads the newest release and description and uploads it to vendors!'
|
|
inputs:
|
|
loader:
|
|
description: "Current Modpack Loader"
|
|
required: true
|
|
game-version:
|
|
description: "Current Modpack Game Version"
|
|
required: true
|
|
upload-modrinth:
|
|
description: "Should the Modpack Be Uploaded to Modrinth"
|
|
required: true
|
|
upload-curse:
|
|
description: "Should the Modpack Be Uploaded to CurseForge"
|
|
required: true
|
|
|
|
MODRINTH_TOKEN:
|
|
required: false
|
|
description: "Token used to uploading modpack to Modrinth"
|
|
MODRINTH_ID:
|
|
required: false
|
|
description: "ID used to uploading modpack to Modrinth"
|
|
CURSEFORGE_TOKEN:
|
|
required: false
|
|
description: "Token used to uploading modpack to Curseforge"
|
|
CURSEFORGE_ID:
|
|
required: false
|
|
description: "ID used to uploading modpack to Curseforge"
|
|
|
|
modpack:
|
|
description: "Modpack directory"
|
|
required: false
|
|
default: .
|
|
|
|
release-tag:
|
|
description: "Tag for the release"
|
|
required: true
|
|
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
|
|
# --- Checkout the repo
|
|
- name: Check Out Git Repository
|
|
uses: actions/checkout@v3
|
|
|
|
# --- Download the pack files
|
|
- name: Download the pack files
|
|
uses: robinraju/[email protected]
|
|
id: download-files
|
|
with:
|
|
fileName: "*"
|
|
tag: ${{ inputs.release-tag }}
|
|
tarBall: false
|
|
zipBall: false
|
|
|
|
|
|
# --- Get latest release description
|
|
- name: Get latest release description
|
|
uses: cardinalby/git-get-release-action@v1
|
|
id: latest-release
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
tag: ${{ inputs.release-tag }}
|
|
|
|
|
|
# --- Set publish version-type
|
|
- name: Set publish version-type
|
|
id: release-type
|
|
run: |
|
|
if [ "${{ steps.latest-release.outputs.prerelease }}" = "true" ]; then
|
|
echo "Setting release-type to beta"
|
|
echo "release-type=beta" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Setting release-type to release"
|
|
echo "release-type=release" >> $GITHUB_OUTPUT
|
|
fi
|
|
shell: bash
|
|
|
|
|
|
# --- Pipe latest release description to file
|
|
- name: Pipe latest release description to file
|
|
run: echo "${{ steps.latest-release.outputs.body }}" > CHANGELOG.release.md
|
|
shell: bash
|
|
|
|
|
|
# --- Print status
|
|
- name: Print status
|
|
run: |
|
|
echo "::notice ::⚙ Assets from latest release ${{ steps.latest-release.outputs.tag_name }} downloaded successfully!"
|
|
echo "::notice ::⚙ Latest release ${{ steps.latest-release.outputs.tag_name }} description piped into a file successfully!"
|
|
shell: bash
|
|
|
|
|
|
- name: Publish to Modrinth
|
|
id: modrinth
|
|
if: inputs.upload-modrinth == 'true'
|
|
uses: Kir-Antipov/[email protected]
|
|
with:
|
|
modrinth-id: ${{ inputs.MODRINTH_ID }}
|
|
modrinth-token: ${{ inputs.MODRINTH_TOKEN }}
|
|
loaders: ${{ env.loader }}
|
|
game-versions: ${{ env.game-version }}
|
|
changelog-file: CHANGELOG.release.*
|
|
files: "*.mrpack"
|
|
version: ${{ inputs.release-tag }}
|
|
version-type: ${{ steps.release-type.outputs.release-type }}
|
|
|
|
- name: Print Modrinth upload status
|
|
if: steps.modrinth.outcome == 'success'
|
|
run: |
|
|
echo "::notice ::☀ Modpack ${{ inputs.modpack }} has been uploaded to Modrinth with ${{ inputs.MODRINTH_ID }}"
|
|
shell: bash
|
|
|
|
- name: Publish to CurseForge
|
|
id: curseforge
|
|
if: inputs.upload-curse == 'true'
|
|
uses: Kir-Antipov/[email protected]
|
|
with:
|
|
curseforge-id: ${{ inputs.CURSEFORGE_ID }}
|
|
curseforge-token: ${{ inputs.CURSEFORGE_TOKEN }}
|
|
loaders: ${{ env.loader }}
|
|
game-versions: ${{ env.game-version }}
|
|
changelog-file: CHANGELOG.release.*
|
|
files: "*.zip"
|
|
version: ${{ inputs.release-tag }}
|
|
version-type: ${{ steps.release-type.outputs.release-type }}
|
|
|
|
- name: Print Curseforge upload status
|
|
if: steps.curseforge.outcome == 'success'
|
|
run: |
|
|
echo "::notice ::☀ Modpack ${{ inputs.modpack }} has been uploaded to Curseforge with ${{ inputs.CURSEFORGE_ID }}"
|
|
shell: bash |