Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 10 additions & 14 deletions .github/actions/build_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,19 @@ runs:
using: 'composite'

steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install uv
- name: Install system dependencies
shell: bash
run: pip install uv
run: |
sudo apt-get update
sudo apt-get install -y zip jq wget

- name: Setup Python Cache
uses: actions/cache@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-uv-
enable-cache: true
python-version-file: ./buildtools/pyproject.toml

- name: Install dependencies
shell: bash
run: uv pip install --system -r ./buildtools/requirements.txt
working-directory: ./buildtools
run: uv sync
74 changes: 32 additions & 42 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,37 @@ on:
workflow_dispatch:
inputs:
target_branch:
description: 'Target branch for the preview'
description: "Target branch for the preview"
type: string
required: true
version:
description: 'Modpack version'
description: "Modpack version"
required: true
preview_version:
description: 'Preview version'
description: "Preview version"
required: true

env:
NAME: "GTExpert2"
VERSION_NORMAL: "v${{ github.event.inputs.version }}-pr-${{ github.event.inputs.preview_version }}"
VERSION_LWJGL3: "v${{ github.event.inputs.version }}-lwjgl3-${{ github.event.inputs.preview_version }}"
JAVA8_CF: "${{ github.event.inputs.version }}-Pre-${{ github.event.inputs.preview_version }}-CF_Java_8"
JAVA8_MMC: "${{ github.event.inputs.version }}-Pre-${{ github.event.inputs.preview_version }}-MMC_Java_8"
JAVA8_SERVER: "${{ github.event.inputs.version }}-Pre-${{ github.event.inputs.preview_version }}-Server_Java_8"
JAVA_OPT: "${{ github.event.inputs.version }}-Pre-${{ github.event.inputs.preview_version }}-MMC_Java_17-25"

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
strategy:
matrix:
buildType: [standard, lwjgl3]

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.target_branch || github.ref }}
fetch-depth: 0

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.cache/pip
key: ${{ runner.os }}-deps-${{ matrix.buildType }}-${{ hashFiles('**/pom.xml') }}

- name: Download Resource Packs zip
run: |
GITHUB_RELEASE=$(curl -s https://api.github.com/repos/GTModpackTeam/GTE2-Translations/releases)
Expand All @@ -64,21 +58,21 @@ jobs:
VER="${{ env.VERSION_LWJGL3 }}"
echo "[CleanroomMMC] GregTech Expert 2 $VER" > overrides/config/txloader/load/custommainmenu/version.txt
else
VER="${{ env.VERSION_NORMAL }}"
VER="${{ env.JAVA8_CF }}"
echo "GregTech Expert 2 $VER" > overrides/config/txloader/load/custommainmenu/version.txt
fi
sed -i "s/MODPACKVERSION/$VER/g" manifest.json instance.cfg overrides/config/craftpresence.json

- name: Adjust for LWJGL3
if: matrix.buildType == 'lwjgl3'
run: |
python buildtools/gen-lwjgl3-manifest.py
uv run --directory ./buildtools python ./gen-lwjgl3-manifest.py
cp -vf cmmc/manifest.json manifest.json

- name: Install Mods
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: python buildtools/mod-install.py
run: uv run --directory ./buildtools python ./mod-install.py

- name: Clean up placeholder files
run: find . -name ".gitkeep" -delete
Expand All @@ -87,21 +81,18 @@ jobs:
run: |
if [[ "${{ matrix.buildType }}" == "lwjgl3" ]]; then
sed -i "s/B:EnableCustomGameTitle=false/B:EnableCustomGameTitle=true/" overrides/config/stellar_core.cfg
cp -rvf cmmc/bansoukou/ ./overrides/
rm -Rf cmmc/bansoukou/
mv -vf overrides/ .minecraft/
cp -vf icon.png .minecraft/
cp -rvf cmmc/* ./
zip -r artifacts/${{ env.NAME }}-${{ env.VERSION_LWJGL3 }}-mmc.zip libraries/ patches/ mmc-pack.json instance.cfg .minecraft/
zip -r artifacts/${{ env.NAME }}-${{ env.JAVA_OPT }}.zip patches/ mmc-pack.json instance.cfg .minecraft/
else
zip -r artifacts/${{ env.NAME }}-${{ env.VERSION_NORMAL }}-cf.zip manifest.json modlist.html overrides/bansoukou/ overrides/config/ overrides/local/ overrides/resourcepacks/icons/ overrides/resourcepacks/GTExpert2-* overrides/scripts/
zip -r artifacts/${{ env.NAME }}-${{ env.JAVA8_CF }}.zip manifest.json modlist.html overrides/config/ overrides/local/ overrides/resourcepacks/icons/ overrides/resourcepacks/GTExpert2-* overrides/scripts/
mv overrides/ .minecraft/
cp icon.png .minecraft/
zip -r artifacts/${{ env.NAME }}-${{ env.VERSION_NORMAL }}-mmc.zip mmc-pack.json instance.cfg .minecraft/
zip -r artifacts/${{ env.NAME }}-${{ env.JAVA8_MMC }}.zip mmc-pack.json instance.cfg .minecraft/
mv serverfiles/* ./
rm -vf .minecraft/mods/!Red-Core-*
rm -vf .minecraft/mods/Alfheim-*
rm -vf .minecraft/mods/Valkyrie-*
rm -vf .minecraft/mods/CraftPresence-*
rm -vf .minecraft/mods/Controlling-*
rm -vf .minecraft/mods/UniLib-*
Expand All @@ -116,33 +107,32 @@ jobs:
rm -vf .minecraft/mods/InGameInfoXML-*
rm -vf .minecraft/mods/oauth-*
rm -vf .minecraft/mods/UntranslatedItems-*
rm -vf .minecraft/mods/vintagefix-*
mv -vf .minecraft/* ./
zip -r artifacts/${{ env.NAME }}-${{ env.VERSION_NORMAL }}-server.zip docker-compose.yml PleaseRead.txt log4j2_112-116.xml Install.* ServerStart.* settings.* TmuxServer.sh bansoukou/ config/ local/ mods/ resources/ scripts/
zip -r artifacts/${{ env.NAME }}-${{ env.JAVA8_SERVER }}.zip docker-compose.yml PleaseRead.txt log4j2_112-116.xml Install.* ServerStart.* settings.* TmuxServer.sh config/ local/ mods/ resources/ scripts/
fi

- name: Upload Artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.buildType }}-artifacts
path: artifacts/
retention-days: 1

release:
needs: build
runs-on: ubuntu-latest
runs-on: ubuntu-slim
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.target_branch || github.ref }}
fetch-depth: 0

- name: Download All Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v6
with:
path: downloads

Expand All @@ -160,28 +150,28 @@ jobs:
run: |
git config --global user.name "github-actions"
git config --global user.email "actions@github.com"
git tag ${{ env.VERSION_NORMAL }}
git push origin ${{ env.VERSION_NORMAL }}
git tag ${{ env.JAVA8_CF }}
git push origin ${{ env.JAVA8_CF }}

- name: Create or Update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.VERSION_NORMAL }}
name: "Preview ${{ env.VERSION_NORMAL }}"
tag_name: "v${{ github.event.inputs.version }}-pr-${{ github.event.inputs.preview_version }}"
name: "v${{ github.event.inputs.version }}-Pre-${{ github.event.inputs.preview_version }}"
body: |
## GregTech Expert 2 - Preview Release
## GregTech Expert 2 Preview - ${{ github.event.inputs.version }}

This preview includes:
- **Standard** (CurseForge / MultiMC / PrismLauncher / Server)
- **LWJGL3** (MultiMC / PrismLauncher only)
- **Java 8** (CurseForge / MultiMC / PrismLauncher / Server)
- **Java 17-25** (MultiMC / PrismLauncher only)

See installation guide for LWJGL3 [here](https://github.com/GTModpackTeam/GregTech-Expert-2/blob/main/cmmc/README.md).
See installation guide for Java 17-25 [here](https://github.com/GTModpackTeam/GregTech-Expert-2/blob/main/cmmc/).
prerelease: true
generate_release_notes: true
files: |
artifacts/${{ env.NAME }}-${{ env.VERSION_NORMAL }}-cf.zip
artifacts/${{ env.NAME }}-${{ env.VERSION_NORMAL }}-mmc.zip
artifacts/${{ env.NAME }}-${{ env.VERSION_NORMAL }}-server.zip
artifacts/${{ env.NAME }}-${{ env.VERSION_LWJGL3 }}-mmc.zip
artifacts/${{ env.NAME }}-${{ env.JAVA8_CF }}.zip
artifacts/${{ env.NAME }}-${{ env.JAVA8_MMC }}.zip
artifacts/${{ env.NAME }}-${{ env.JAVA8_SERVER }}.zip
artifacts/${{ env.NAME }}-${{ env.JAVA_OPT }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading