-
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (76 loc) · 3.24 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches: [ dev ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get latest release version
id: latest-release
uses: fangqiuming/[email protected]
- name: Replace version
run: |
echo "VERSION=${{ steps.latest-release.outputs.tag_name }}-$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
sed -i "s/_VERSION_/${{ steps.latest-release.outputs.tag_name }}/g" config/fabric_loader_dependencies.json
find . -type f -exec sed -i "s/_VERSION_/${{ steps.latest-release.outputs.tag_name }}-$(git rev-parse --short "$GITHUB_SHA")/g" {} +
find . -type f -exec sed -i "s/_COMMIT_/${{ github.sha }}/g" {} +
- name: Install Packwiz
run: |
sudo curl -L https://github.com/REVanillaW/packwiz/releases/download/CI/packwiz-linux-amd64 -o /bin/packwiz
sudo chmod +x /bin/packwiz
packwiz refresh --build
- name: Export Modrinth modpack
run: |
packwiz rehash sha256
packwiz modrinth export
- name: Upload Modrinth modpack
uses: actions/upload-artifact@v4
with:
name: Modrinth
path: Titanium Optimized-${{ env.VERSION }}.mrpack
if-no-files-found: error
- name: Export CurseForge modpack
run: |
packwiz rehash sha1
packwiz curseforge export
- name: Upload CurseForge modpack
uses: actions/upload-artifact@v4
with:
name: CurseForge
path: Titanium Optimized-${{ env.VERSION }}.zip
if-no-files-found: error
- name: Update mods
run: |
packwiz update --all -y | tee UPDATE_LOG
if [ `grep -c "All files are up to date!" UPDATE_LOG` -ne "1" ]; then echo "::warning title=Update Available::Some mods can be updated."; fi
run:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: Modrinth
- name: Install Console Minecraft Launcher
run: curl -L https://github.com/MrShieh-X/console-minecraft-launcher/releases/download/2.2.1/cmcl.jar -o cmcl.jar
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: Install modpack
run: |
mv *.mrpack CI.mrpack
java -jar cmcl.jar config downloadSource 0
java -jar cmcl.jar modpack --file="CI.mrpack" --storage=CI --no-assets
- name: Run Minecraft
run: |
java -jar cmcl.jar account --login=offline --name=PlusVanilla
java -jar cmcl.jar config exitWithMinecraft true
java -jar cmcl.jar config printStartupInfo true
java -jar cmcl.jar config checkAccountBeforeStart false
echo "0" | java -jar cmcl.jar CI
if [ `grep -c "java.lang.IllegalStateException: Failed to initialize GLFW, errors: GLFW error during init" .minecraft/versions/CI/crash-reports/crash-*-client.txt` -ne "1" ]; then echo "::error title=Game crashed::Oops." && exit 1; fi