mirror of
https://github.com/darksaid98/optim.git
synced 2026-12-01 14:38:49 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47bd176014 | ||
|
|
a18ce0a8d0 | ||
|
|
f5e25ee6a3 | ||
|
|
a90510df58 | ||
|
|
a43e941dd7 | ||
|
|
92f64c8baa | ||
|
|
bc965156b2 |
No files matched your search
@@ -12,5 +12,6 @@ runs:
|
||||
steps:
|
||||
# Update version fields for client pack
|
||||
- name: Update client versions
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -b 's/^version = .*/version = "${{ inputs.version }}"/' ./main/pack.toml
|
||||
@@ -5,8 +5,8 @@ runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: LFS Create File List
|
||||
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
|
||||
shell: bash
|
||||
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
|
||||
|
||||
- name: LFS Cache
|
||||
uses: actions/cache@v4
|
||||
@@ -17,6 +17,6 @@ runs:
|
||||
${{ runner.os }}-lfs-
|
||||
|
||||
- name: LFS Pull
|
||||
run: git lfs pull
|
||||
shell: bash
|
||||
run: git lfs pull
|
||||
|
||||
@@ -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,90 @@
|
||||
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 Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: Modpack-Release
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
merge-multiple: true
|
||||
|
||||
# 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.*
|
||||
@@ -50,9 +50,9 @@ jobs:
|
||||
|
||||
# Refresh packwiz files (Client)
|
||||
- name: Refresh Packwiz Index Client
|
||||
shell: bash
|
||||
run: |
|
||||
packwiz refresh
|
||||
shell: bash
|
||||
working-directory: ./main
|
||||
|
||||
# Commit and push updated files
|
||||
@@ -64,17 +64,34 @@ jobs:
|
||||
|
||||
# Package release (Client)
|
||||
- name: Build CurseForge Client Modpack
|
||||
shell: bash
|
||||
run: |
|
||||
packwiz curseforge export --output Optim-${{ github.ref_name }}.zip
|
||||
shell: bash
|
||||
working-directory: ./main
|
||||
|
||||
- name: Build Modrinth Client Modpack
|
||||
shell: bash
|
||||
run: |
|
||||
packwiz modrinth export --output Optim-${{ github.ref_name }}.mrpack
|
||||
shell: bash
|
||||
working-directory: ./main
|
||||
|
||||
# Upload artifacts of release files
|
||||
- name: Upload Release Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Modpack-Release
|
||||
path: |
|
||||
./main/Optim-${{ github.ref_name }}.zip
|
||||
./main/Optim-${{ github.ref_name }}.mrpack
|
||||
retention-days: 1
|
||||
|
||||
# Fetch modpack metadata from the modpack config
|
||||
- name: Read Modpack Metadata
|
||||
id: metadata
|
||||
uses: ./.github/actions/meta
|
||||
with:
|
||||
working-directory: ./main
|
||||
|
||||
# Generate changelog
|
||||
- name: Generate changelog
|
||||
uses: ardalanamini/auto-changelog@v4
|
||||
@@ -105,7 +122,7 @@ jobs:
|
||||
use-github-autolink: true
|
||||
|
||||
# Create release
|
||||
- name: Create Release Client
|
||||
- name: Create Release Client (GitHub)
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
@@ -117,3 +134,18 @@ jobs:
|
||||
prerelease: false
|
||||
generate_release_notes: false
|
||||
body: ${{ steps.changelog.outputs.changelog }}
|
||||
|
||||
- name: Create Release Client (Modrinth & CurseForge)
|
||||
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"
|
||||
author = "darksaid98"
|
||||
version = "v1.9.1"
|
||||
version = "v1.9.4"
|
||||
pack-format = "packwiz:1.1.0"
|
||||
|
||||
[index]
|
||||
|
||||
Reference in new issue
Block a user