-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.43 KB
/
publish.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
name: Publish on GitHub, CurseForge & Modrinth
on: [workflow_dispatch]
env:
MINECRAFT_VERSION: 1.18.2
JAVA_VERSION: 17
VERSION: 1.0.3+1.18.2
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
permissions:
contents: write
jobs:
build:
strategy:
matrix:
version:
[
{ dir: "Fabric", loader: "fabric" },
{ dir: "Forge", loader: "forge" },
]
runs-on: "ubuntu-22.04"
steps:
- name: Check Environment Variables
run: env
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17
- name: Make Gradle Wrapper Executable
working-directory: ${{ matrix.version.dir }}
run: chmod +x ./gradlew
- name: Build
working-directory: ${{ matrix.version.dir }}
run: ./gradlew clean build
- name: Remove sources jar
run: rm -f ${{ matrix.version.dir }}/build/libs/*-sources.jar
- name: Capture Build Artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: ${{ matrix.version.dir }}/build/libs/
- name: Publish (CurseForge/Modrinth/GitHub)
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 882715
curseforge-token: "${{env.CURSEFORGE_TOKEN}}"
modrinth-id: oTmCQ7Y1
modrinth-token: "${{env.MODRINTH_TOKEN}}"
github-tag: "v${{env.VERSION}}_${{ matrix.version.dir }}"
github-token: "${{env.GITHUB_TOKEN}}"
name: "${{env.VERSION}}_${{ matrix.version.dir }}"
version: "${{env.VERSION}}"
version-type: release
game-versions: "${{env.MINECRAFT_VERSION}}"
java: "${{env.JAVA_VERSION}}"
files: ${{ matrix.version.dir }}/build/libs/*.jar
loaders: ${{ matrix.version.loader }}