mirror of
https://github.com/darksaid98/optim.git
synced 2026-12-01 22:16:40 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a90510df58 | ||
|
|
a43e941dd7 |
No files matched your search
@@ -0,0 +1,46 @@
|
|||||||
|
name: 'Read Metadata'
|
||||||
|
description: 'Reads metadata from modpack config and outputs it.'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
working-directory:
|
||||||
|
description: 'Path to the modpack directory'
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
|
pack-file:
|
||||||
|
description: 'Path to the pack config file'
|
||||||
|
required: false
|
||||||
|
default: 'pack.toml'
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
mod-loader:
|
||||||
|
description: 'Detected mod loader'
|
||||||
|
value: ${{ steps.read.outputs.mod-loader }}
|
||||||
|
minecraft-version:
|
||||||
|
description: 'Detected minecraft version'
|
||||||
|
value: ${{ steps.read.outputs.minecraft-version }}
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
# Checkout repository
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Read metadata in pack.toml and output to workflow
|
||||||
|
- name: Read Metadata
|
||||||
|
id: read
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ inputs.working-directory }}
|
||||||
|
run: |
|
||||||
|
loaders=("fabric" "forge" "quilt" "neoforge", "rift")
|
||||||
|
for loader in "${loaders[@]}"; do
|
||||||
|
if [[ $(<"pack.toml") == *"$loader ="* ]]; then
|
||||||
|
MODPACK_MODLOADER="$loader" && break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
[[ -z "$MODPACK_MODLOADER" ]] && { echo "::error file=pack.toml::No valid modpack loader found in pack.toml" && exit 1; }
|
||||||
|
|
||||||
|
MODPACK_MINECRAFT_VERSION=$(grep -oP 'minecraft = "\K[^"]+' "pack.toml")
|
||||||
|
echo "mod-loader=$MODPACK_MODLOADER" >> $GITHUB_ENV
|
||||||
|
echo "minecraft-version=$MODPACK_MINECRAFT_VERSION" >> $GITHUB_ENV
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
name: 'Publish Release On External Platforms'
|
||||||
|
description: 'Publish a release to specific modding platforms.'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
modrinth:
|
||||||
|
description: "Whether to upload to Modrinth"
|
||||||
|
required: true
|
||||||
|
curseforge:
|
||||||
|
description: "Whether to upload to CurseForge"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
working-directory:
|
||||||
|
description: 'Path to the modpack directory'
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
|
version:
|
||||||
|
description: 'Modpack version'
|
||||||
|
required: true
|
||||||
|
default: '1.0.0'
|
||||||
|
mod-loader:
|
||||||
|
description: "Detected mod loader"
|
||||||
|
required: true
|
||||||
|
default: 'fabric'
|
||||||
|
minecraft-version:
|
||||||
|
description: "Detected minecraft version"
|
||||||
|
required: true
|
||||||
|
changelog:
|
||||||
|
description: "The changelog as markdown text"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
MODRINTH_TOKEN:
|
||||||
|
required: false
|
||||||
|
description: "Token used for authenticating with Modrinth API"
|
||||||
|
MODRINTH_ID:
|
||||||
|
required: false
|
||||||
|
description: "Identifier used for authenticating with Modrinth API"
|
||||||
|
CURSEFORGE_TOKEN:
|
||||||
|
required: false
|
||||||
|
description: "Token used for authenticating with CurseForge API"
|
||||||
|
CURSEFORGE_ID:
|
||||||
|
required: false
|
||||||
|
description: "Identifier used for authenticating with CurseForge API"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
# Checkout repository
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Download release files
|
||||||
|
- name: Download Release
|
||||||
|
uses: robinraju/[email protected]
|
||||||
|
with:
|
||||||
|
fileName: "*"
|
||||||
|
tag: ${{ inputs.version }}
|
||||||
|
tarBall: false
|
||||||
|
zipBall: false
|
||||||
|
|
||||||
|
# Create a markdown file of the release description
|
||||||
|
- name: Pipe Release Description to File
|
||||||
|
shell: bash
|
||||||
|
run: echo "${{ inputs.changelog }}" > CHANGELOG.release.md
|
||||||
|
|
||||||
|
# Publish release to Modrinth
|
||||||
|
- name: Publish to Modrinth
|
||||||
|
if: inputs.modrinth == 'true'
|
||||||
|
uses: Kir-Antipov/[email protected]
|
||||||
|
with:
|
||||||
|
modrinth-id: ${{ inputs.MODRINTH_ID }}
|
||||||
|
modrinth-token: ${{ inputs.MODRINTH_TOKEN }}
|
||||||
|
loaders: ${{ inputs.mod-loader }}
|
||||||
|
game-versions: ${{ inputs.minecraft-version }}
|
||||||
|
files: "*.mrpack"
|
||||||
|
version: ${{ inputs.version }}
|
||||||
|
version-type: release
|
||||||
|
changelog-file: CHANGELOG.release.*
|
||||||
|
|
||||||
|
# Publish release to CurseForge
|
||||||
|
- name: Publish to CurseForge
|
||||||
|
if: inputs.curseforge == 'true'
|
||||||
|
uses: Kir-Antipov/[email protected]
|
||||||
|
with:
|
||||||
|
curseforge-id: ${{ inputs.CURSEFORGE_ID }}
|
||||||
|
curseforge-token: ${{ inputs.CURSEFORGE_TOKEN }}
|
||||||
|
loaders: ${{ inputs.mod-loader }}
|
||||||
|
game-versions: ${{ inputs.minecraft-version }}
|
||||||
|
files: "*.zip"
|
||||||
|
version: ${{ inputs.version }}
|
||||||
|
version-type: release
|
||||||
|
changelog-file: CHANGELOG.release.*
|
||||||
@@ -75,6 +75,13 @@ jobs:
|
|||||||
packwiz modrinth export --output Optim-${{ github.ref_name }}.mrpack
|
packwiz modrinth export --output Optim-${{ github.ref_name }}.mrpack
|
||||||
working-directory: ./main
|
working-directory: ./main
|
||||||
|
|
||||||
|
# Fetch modpack metadata from the modpack config
|
||||||
|
- name: Read Modpack Metadata
|
||||||
|
id: metadata
|
||||||
|
uses: ./.github/actions/meta
|
||||||
|
with:
|
||||||
|
working-directory: ./main
|
||||||
|
|
||||||
# Generate changelog
|
# Generate changelog
|
||||||
- name: Generate changelog
|
- name: Generate changelog
|
||||||
uses: ardalanamini/auto-changelog@v4
|
uses: ardalanamini/auto-changelog@v4
|
||||||
@@ -105,7 +112,7 @@ jobs:
|
|||||||
use-github-autolink: true
|
use-github-autolink: true
|
||||||
|
|
||||||
# Create release
|
# Create release
|
||||||
- name: Create Release Client
|
- name: Create Release Client (GitHub)
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
@@ -117,3 +124,18 @@ jobs:
|
|||||||
prerelease: false
|
prerelease: false
|
||||||
generate_release_notes: false
|
generate_release_notes: false
|
||||||
body: ${{ steps.changelog.outputs.changelog }}
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
|
|
||||||
|
- name: Create Release Client (Modrinth)
|
||||||
|
uses: ./.github/actions/release
|
||||||
|
with:
|
||||||
|
working-directory: ./main
|
||||||
|
version: ${{ github.ref_name }}
|
||||||
|
mod-loader: ${{ steps.metadata.outputs.mod-loader }}
|
||||||
|
minecraft-version: ${{ steps.metadata.outputs.minecraft-version }}
|
||||||
|
modrinth: true
|
||||||
|
curseforge: true
|
||||||
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
||||||
|
MODRINTH_ID: ${{ secrets.MODRINTH_ID }}
|
||||||
|
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
|
||||||
|
CURSEFORGE_ID: ${{ secrets.CURSEFORGE_ID }}
|
||||||
|
changelog: ${{ steps.changelog.outputs.changelog }}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name = "Optim"
|
name = "Optim"
|
||||||
author = "darksaid98"
|
author = "darksaid98"
|
||||||
version = "v1.9.1"
|
version = "v1.9.3"
|
||||||
pack-format = "packwiz:1.1.0"
|
pack-format = "packwiz:1.1.0"
|
||||||
|
|
||||||
[index]
|
[index]
|
||||||
|
|||||||
Reference in new issue
Block a user