-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (74 loc) · 2.16 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
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
name: Build and upload mod
on:
release:
types: [ published ]
branches: [ forge-1.19.4 ]
jobs:
path:
name: Generate file path
runs-on: ubuntu-latest
outputs:
file_path: ${{steps.file.outputs.file_path}}
steps:
- name: Generate file path
id: file
run: echo "file_path=./build/libs/multiverse-$(echo ${{github.event.release.tag_name}} | cut -dv -f2).jar" >> $GITHUB_OUTPUT
build:
name: Build and cache
runs-on: ubuntu-latest
needs: [ path ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate data
run: ./gradlew :runData
- name: Build
run: ./gradlew :build
- name: Cache
uses: actions/cache@v4
with:
path: ${{needs.path.outputs.file_path}}
key: ${{github.sha}}
release:
name: Upload to release
runs-on: ubuntu-latest
needs: [ path,build ]
steps:
- name: Restore cache
uses: actions/cache@v4
with:
path: ${{needs.path.outputs.file_path}}
key: ${{github.sha}}
- name: Upload to release
uses: softprops/action-gh-release@v2
with:
files: ${{needs.path.outputs.file_path}}
curseforge:
name: Upload to CurseForge
runs-on: ubuntu-latest
needs: [ path,build ]
steps:
- name: Restore cache
uses: actions/cache@v4
with:
path: ${{needs.path.outputs.file_path}}
key: ${{github.sha}}
- name: Upload to CurseForge
uses: itsmeow/curseforge-upload@v3.1.2
with:
token: ${{secrets.curseforge_api}}
project_id: 561392
game_endpoint: minecraft
file_path: ${{needs.path.outputs.file_path}}
changelog: ${{github.event.release.body}}
display_name: ${{github.event.release.name}}
release_type: release
game_versions: minecraft-1-19:1.19.4,java:Java 17,Forge