-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (38 loc) · 1.07 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
name: build
on:
push:
branches: [ "main", "develop", "version/*" ]
pull_request:
branches: [ "main", "develop", "version/*" ]
workflow_dispatch:
inputs:
publish:
description: Publish to Modrinth and CurseForge
required: true
default: "false"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
if: ${{ !github.event.inputs.publish }}
run: ./gradlew build
- name: Publish with Gradle
if: ${{ github.event.inputs.publish }}
env:
MODRINTH_TOKEN: ${{secrets.MODRINTH_TOKEN}}
CURSEFORGE_TOKEN: ${{secrets.CURSE_TOKEN}}
MODRINTH_ID: ${{vars.MODRINTH_ID}}
CURSEFORGE_ID: ${{vars.CURSE_ID}}
run: ./gradlew build publishMods