forked from turikhay/MapModCompanion
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (63 loc) · 1.69 KB
/
build.yml
File metadata and controls
67 lines (63 loc) · 1.69 KB
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
name: Gradle build
on:
workflow_call:
inputs:
version:
required: true
type: string
spigot-target:
type: string
task:
type: string
default: build
dependency-graph:
type: string
default: generate-and-upload
outputs:
artifact:
description: Path to the jar artifact
value: ${{ jobs.build.outputs.artifact }}
secrets:
hangar-token:
required: false
modrinth-token:
required: false
permissions:
contents: write
jobs:
build:
name: Run Gradle
env:
ARTIFACT: packages/single/build/libs/MapModCompanion.jar
outputs:
artifact: ${{ env.ARTIFACT }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Gradle
uses: ./.github/actions/setup_gradle
with:
dependency-graph: ${{ inputs.dependency-graph }}
- name: Determine target Spigot version
id: target
run: |
TARGET=${{ inputs.spigot-target }}
[[ -z "$TARGET" ]] && TARGET=$(tail -n1 VERSIONS.txt)
echo "spigot-version=$TARGET" >> $GITHUB_OUTPUT
- name: Run the task
run: |
./gradlew \
${{ inputs.task }} \
-Pversion=${{ inputs.version }} \
-Pspigot_version=${{ steps.target.outputs.spigot-version }}
env:
HANGAR_TOKEN: ${{ secrets.hangar-token }}
MODRINTH_TOKEN: ${{ secrets.modrinth-token }}
- name: Force original path preservation
run: touch .empty
- uses: actions/upload-artifact@v5
with:
name: gradle-build
path: |
.empty
${{ env.ARTIFACT }}