generated from EpimorphicPioneers/ArchLoom-TemplateMod
-
Notifications
You must be signed in to change notification settings - Fork 5
58 lines (49 loc) · 1.59 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: CI For ExampleMod
on:
push:
paths:
- .github/workflows/**
- src/**
- gradle/scripts/**
- build.gradle
- gradle.properties
- settings.gradle
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_ACTION_NUMBER: ${{ vars.GITHUB_RUN_NUMBER }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java 17
uses: actions/[email protected]
with:
distribution: zulu
java-version: 17
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew build
- name: Read Properties
id: 'properties'
uses: christian-draeger/[email protected]
with:
path: gradle.properties
properties: 'mod_id mod_name'
- name: Get Version
id: var
run: |
MESSAGE=$(ls build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-|.jar' '{print $2}')
echo version=$MESSAGE >> $GITHUB_OUTPUT
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: "${{ steps.properties.outputs.mod_name }} ${{ steps.var.outputs.version }}"
path: build/libs/${{ steps.properties.outputs.mod_id }}-${{ steps.var.outputs.version }}.jar