-
-
Notifications
You must be signed in to change notification settings - Fork 19
50 lines (45 loc) · 1.38 KB
/
build.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
name: 'Build'
on:
push:
env:
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
CURSE_KEY: ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }}
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create changelog
run: |
{
echo 'CHANGELOG<<EOF'
git log ${{ github.event.before }}...${{ github.event.after }} --pretty=format:"\[[%h](https://github.com/$GITHUB_REPOSITORY/commit/%H)\] %s (%cn) "
echo ""
echo EOF
} >> "$GITHUB_ENV"
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '21'
cache: 'gradle'
- name: Make Gradle Wrapper Executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
# Build
- name: Build with Gradle
run: ./gradlew clean generateRemapClasspath build
# Publish
- name: Publish CurseForge
run: ./gradlew :Forge:publishCurseForge :Fabric:publishCurseForge :NeoForge:publishCurseForge
- name: Publish Modrinth
run: ./gradlew :Forge:modrinth :Fabric:modrinth :NeoForge:modrinth
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: output/*[^shadow].jar