forked from Laskyyy/Create-Astral
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (113 loc) · 4.55 KB
/
packwiz.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build with packwiz
on:
workflow_dispatch:
inputs:
artifacts:
description: Upload artifacts
required: true
default: "true"
serverpack:
description: Create serverpack
required: true
default: "true"
publish:
description: Publish version to CurseForge
required: false
default: "false"
pull_request:
branches: ["main", "Astral-Experimental"]
push:
branches: ["main", "Astral-Experimental"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: setup jdk 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"
- name: Get latest packwiz binary
id: download-packwiz
uses: dawidd6/action-download-artifact@v6
with:
workflow: go.yml
branch: main
name: Linux 64-bit x86
repo: packwiz/packwiz
- name: Make packwiz binary executable
run: chmod +x ./packwiz
- name: Restore cached mod downloads
id: cache-mods-restore
uses: actions/cache/restore@v4
with:
path: /home/runner/.cache/packwiz/cache
key: cached-mods
restore-keys: |
cached-mods-
- name: Construct version string
id: construct-base-name
run: |
echo "ASTRAL_BASE_NAME=create_astral-${{github.run_number}}" >> "$GITHUB_OUTPUT"
- name: Create CurseForge client zip
run: |
./packwiz curseforge export -o ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-client.zip
- name: Prepare for serverpack creation
if: ${{ github.event.inputs.serverpack }}
run: |
cat server.packwizignore >> .packwizignore
mv serverpack/* ./
./packwiz refresh
mkdir server
- name: Download packwiz-installer-bootstrap
if: ${{ github.event.inputs.serverpack }}
uses: robinraju/[email protected]
with:
repository: packwiz/packwiz-installer-bootstrap
latest: true
fileName: packwiz-installer-bootstrap.jar
- name: Create serverpack
if: ${{ github.event.inputs.serverpack }}
run: |
cd server
java -jar ../packwiz-installer-bootstrap.jar -g -s server ../pack.toml
rm -f packwiz-installer.jar
ls -l
cd ../
- name: Cache mod downloads
id: cache-mods-save
uses: actions/cache/save@v4
with:
path: |
/home/runner/.cache/packwiz/cache
./server/mods
key: cached-mods-${{ hashFiles('/home/runner/.cache/packwiz/cache/**/*') }}-${{ hashFiles('./server/mods') }}
# Otherwise the artifact would be a zip in a zip, which can't be automatically installed in launchers
- name: Unpack client pack for nicer artifact
if: ${{github.event.inputs.artifacts}}
run: |
unzip ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-client.zip -d ./client
- name: Upload client pack to GitHub
if: ${{ github.event.inputs.artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-client
path: ./client
- name: Upload serverpack to GitHub
if: ${{ github.event.inputs.serverpack && github.event.inputs.artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{steps.construct-base-name.outputs.ASTRAL_BASE_NAME}}-server
path: ./server
# This job publishes the modpack to CurseForge
publish:
runs-on: ubuntu-latest
needs: build
if: ${{github.event.inputs.publish}}
steps:
- name: Prepare files
uses: actions/download-artifact@v4
- name: List files
run: ls -l