-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (37 loc) · 1.98 KB
/
release.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
name: YOURMOD Release Pipeline
on: [workflow_dispatch] # Will be executed only if you start it manually
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [1.7.10-forge, 1.10.2-forge, 1.11.2-forge, 1.12.2-forge, 1.14.4-forge, 1.15.2-forge, 1.16.5-forge] # Enter here all branches/Minecraft versions for which you want to build the mod
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: '1.8' # The JDK version to make available on the path.
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
architecture: x64 # (x64 or x86) - defaults to x64
- name: Install deps
run: sudo apt install -y pngquant findutils xvfb
- name: Hack Forge Gradle
run: mkdir -p ~/.gradle/caches/minecraft/; wget 'https://teamopenindustry.cc/maven/hack/ForgeGradleVersion.json' -O ~/.gradle/caches/minecraft/ForgeGradleVersion.json
- name: Setup Universal Mod Core (and helpers)
env:
BRANCH: ${{ matrix.branch }}
run: ./gradlew umc -D umc.loader=${BRANCH} -D ssh.http=true -Dtarget=release
- name: Gradle compile
run: ./gradlew classes
- name: Process images
run: find src/main/resources/assets/YOURMOD/ | grep png | xargs -I foo pngquant -s1 -f --ext .png foo # Replace YOURMOD with your path
- name: Run Data (optionalish)
run: xvfb-run --auto-servernum ./gradlew runData || xvfb-run --auto-servernum ./gradlew runData || true
- name: Gradle build
run: ./gradlew build -Dtarget=release
- uses: actions/upload-artifact@v2
with:
name: YOURMOD ${{matrix.branch}} # Replace YOURMOD with your mod name
path: build/libs/YOURMOD-${{matrix.branch}}-* # Replace YOURMOD with your mod name
# Do whatever you want here. E.g. you can upload the files directly to CurseForge, here you can find an example: https://github.com/LandOfRails/LandOfSignals/blob/main/.github/workflows/release.yml