-
-
Notifications
You must be signed in to change notification settings - Fork 236
58 lines (56 loc) · 1.66 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
51
52
53
54
55
56
57
58
name: Build
on:
push:
branches:
- stable
- main
paths:
- '**.java'
pull_request:
branches:
- main
paths:
- '**.java'
workflow_dispatch:
inputs:
upload_artifact:
description: 'Upload artifact to this run? [yes | no]'
required: false
default: 'no'
jobs:
build:
name: Build
if: ${{ !contains(github.head_ref, 'translations/') }}
runs-on: ubuntu-latest
env:
ORG_GRADLE_PROJECT_buildNumber: ${{ github.run_number }}
ORG_GRADLE_PROJECT_runAttempt: ${{ github.run_attempt }}
ORG_GRADLE_PROJECT_runningOnCi: ${{ true }}
UPLOAD_ARTIFACT_ENABLED: ${{ true }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '18'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --no-daemon
- name: Read Project Version
id: read_project_version
if: ${{ env.UPLOAD_ARTIFACT_ENABLED || contains(github.event.inputs.upload_artifact, 'yes') }}
uses: christian-draeger/[email protected]
with:
path: gradle.properties
property: version
- name: Upload Artifact
if: ${{ env.UPLOAD_ARTIFACT_ENABLED || contains(github.event.inputs.upload_artifact, 'yes') }}
env:
project_version: ${{ steps.read_project_version.outputs.value }}
uses: actions/upload-artifact@v2
with:
name: SkyblockAddons v${{ env.project_version }}+${{ env.ORG_GRADLE_PROJECT_buildNumber }}
path: build/libs/*