-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (64 loc) · 2.18 KB
/
ci.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: CI for Mod
on:
push:
branches:
- main
- releases/**
paths:
- common/**
- fabric/**
- forge/**
- build.gradle
- gradle.properties
- settings.gradle
jobs:
# gametest:
# secrets: inherit
# uses: ./.github/workflows/gametest.yml
build:
runs-on: ubuntu-latest
env:
CI_BUILD: true
PR_BUILD: false
steps:
- name: checkout
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Read Properties
id: 'properties'
uses: christian-draeger/[email protected]
with:
path: gradle.properties
properties: 'mod_id mod_name java_version'
- name: Setup Java ${{ steps.properties.outputs.java_version }}
uses: actions/[email protected]
with:
distribution: zulu
java-version: ${{ steps.properties.outputs.java_version }}
- 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: Get Version
id: version
run: |
MESSAGE=$(ls forge/build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-forge-|.jar' '{print $2}')
echo "version=$MESSAGE" >> $GITHUB_OUTPUT
- name: capture build artifacts
uses: actions/[email protected]
with:
name: "${{ steps.properties.outputs.mod_name }} ${{ steps.version.outputs.version }}"
path: |
fabric/build/libs/${{ steps.properties.outputs.mod_id }}-fabric-${{ steps.version.outputs.version }}.jar
forge/build/libs/${{ steps.properties.outputs.mod_id }}-forge-${{ steps.version.outputs.version }}.jar
# - name: Publish to maven
# run: ./gradlew publish
# env:
# MAVEN_URL: ${{ secrets.MAVEN_URL }}
# MAVEN_USERNAME: ${{ secrets.MAVEN_USER }}
# MAVEN_PASSWORD: ${{ secrets.MAVEN_PASS }}
# continue-on-error: true