forked from Anvil-Dev/AnvilCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.67 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
name: CI for AnvilCraftMod
on:
push:
branches:
- releases/**
paths:
- common/**
- fabric/**
- forge/**
- build.gradle
- gradle.properties
- settings.gradle
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3.1.0
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Java 17
uses: actions/setup-java@v3.6.0
with:
distribution: zulu
java-version: 17
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build
uses: gradle/gradle-build-action@v2.4.2
env:
GITHUB_RUN_NUMBER: ${{ vars.GITHUB_RUN_NUMBER }}
with:
arguments: 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 'anvilcraft-forge-|.jar' '{print $2}')
echo "version=$MESSAGE" >> $GITHUB_OUTPUT
- name: capture build artifacts
uses: actions/upload-artifact@v3.1.1
with:
name: AnvilCraftMod ${{ steps.version.outputs.version }}
path: |
fabric/build/libs/anvilcraft-fabric-${{ steps.version.outputs.version }}.jar
forge/build/libs/anvilcraft-forge-${{ steps.version.outputs.version }}.jar
- name: Publish to maven
run: ./gradlew publish
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}