Compare commits

...
11 Commits
Author SHA1 Message Date
darksaid98 6ccc748afc ci: fix missing uploads to github 2024-12-12 07:37:25 +01:00
darksaid98 4f5d947532 v1.9.6 2024-12-12 06:18:29 +00:00
darksaid98 6702487b4f ci: fix missing mod-loader field 2024-12-12 07:17:57 +01:00
darksaid98 0572f0b7ff v1.9.5 2024-12-12 06:13:30 +00:00
darksaid98 47bd176014 Merge branch 'main' of https://github.com/darksaid98/optim 2024-12-12 07:12:50 +01:00
darksaid98 a18ce0a8d0 ci: use artifacts to pass release files 2024-12-12 07:12:46 +01:00
darksaid98 f5e25ee6a3 v1.9.4 2024-12-12 06:02:43 +00:00
darksaid98 a90510df58 ci: release to other modding platforms 2024-12-12 07:01:46 +01:00
darksaid98 a43e941dd7 v1.9.3 2024-12-12 04:36:34 +00:00
darksaid98 92f64c8baa ci: provide default shell 2024-12-12 05:36:05 +01:00
darksaid98 bc965156b2 ci: fix missing shell definition 2024-12-12 05:31:57 +01:00
6 changed files with 172 additions and 7 deletions

No files matched your search

+1
View File
@@ -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
+2 -2
View File
@@ -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
+42
View File
@@ -0,0 +1,42 @@
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:
# 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
+90
View File
@@ -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: ${{ env.mod-loader }}
game-versions: ${{ env.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: ${{ env.mod-loader }}
game-versions: ${{ env.minecraft-version }}
files: "*.zip"
version: ${{ inputs.version }}
version-type: release
changelog-file: CHANGELOG.release.*
+36 -4
View File
@@ -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
View File
@@ -1,6 +1,6 @@
name = "Optim"
author = "darksaid98"
version = "v1.9.1"
version = "v1.9.6"
pack-format = "packwiz:1.1.0"
[index]