forked from IdeallandEarthDept/IdeallandFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.7 KB
/
build_test.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
# This workflow will build and upload test artifact
# Simple workflow with ignoring condition to prevent unneccessary build
# To download artifact check on job task
name: Build Test Artifact
on:
push:
pull_request:
jobs:
build:
name: Build and Test For example
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Grant Execute Permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle
uses: actions/cache@v3
with:
path:
~/gradle/
~/.gradle/
~/build/
key: ${{hashFiles('build.gradle') }}-${{hashFiles('gradle.properties') }}
restore-keys: |
${{hashFiles('build.gradle') }}-${{hashFiles('gradle.properties') }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Change mod version
run: sed -i "s/mod_version.*=.*/mod_version = ${{ steps.date.outputs.date }}/g" version.properties
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
cache: gradle
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build --info --stacktrace
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: example-1.12.2-${{ steps.date.outputs.date }}-${{ github.run_number}}
path: build/libs