-
-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (46 loc) · 1.6 KB
/
gradle.build.yaml
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
# Based off https://github.com/MinecraftForge/SharedActions/blob/main/.github/workflows/gradle.yml
name: Gradle Building CI
on:
workflow_call:
inputs:
java:
description: "The version of Java to use to run Gradle" # Note: Gradle's Java toolchains feature is used for compiling, which is separate from this
required: false
type: string
default: "21"
gradle_tasks:
description: "The Gradle task(s) to run for building"
required: false
type: string
default: "assemble"
secrets:
GRADLE_ENCRYPTION_KEY:
description: The AES key to enable Gradle cache encryption
required: false
permissions:
contents: read
jobs:
compute-version:
name: Compute version
runs-on: ubuntu-latest
steps:
- uses: ldtteam/operapublicacreator/.github/workflows/gradle.version.yaml@${{ github.workflow_sha }}
with:
suffix: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || format('branch-{0}', steps.computeBranchSuffix.outputs.branch_suffix) }}
build:
runs-on: ubuntu-latest
steps:
- id: checkout
name: "📦 Checkout"
uses: actions/checkout@v4
- id: setupGradle
name: "🔧 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- id: build
name: "🏗️ Build"
run: ./gradlew --build-cache ${{ inputs.gradle_tasks }}
env:
Version: "${{ needs.compute-version.outputs.version }}"