11name : Java CI with Gradle
22
3- on : [ push ]
3+ on :
4+ push :
5+ branches :
6+ - master
7+ pull_request :
8+ branches :
9+ - master
410
511jobs :
612 build :
713 runs-on : ubuntu-latest
814 steps :
915 - name : Checkout
10- uses : actions/checkout@v2.3.5
11- - name : Set up JDK 11
12- uses : actions/setup-java@v2.3.1
16+ uses : actions/checkout@v3.0.0
17+ - name : Set up JDK
18+ uses : actions/setup-java@v3.0.0
1319 with :
1420 distribution : adopt
1521 java-version : 11
16- - name : Cache gradle
17- 18- with :
19- path : |
20- ~/.gradle/caches
21- ~/.gradle/wrapper
22- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
23- restore-keys : ${{ runner.os }}-gradle-
24- - name : Build
22+ - name : Build VelocityTools
2523 run : ./gradlew build
26- - name : Upload a build artifact
27- uses : actions/upload-artifact@v2.2.4
24+ - name : Upload VelocityTools
25+ uses : actions/upload-artifact@v3.0.0
2826 with :
2927 name : VelocityTools
30- path : build/libs/velocity_tools- *.jar
28+ path : " */ build/libs/*.jar"
3129 -
uses :
dev-drprasad/[email protected] 30+ if : ${{ github.event_name == 'push' }}
3231 with :
3332 delete_release : true
3433 tag_name : dev-build
3534 env :
3635 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
36+ - name : Find git version
37+ id : git-version
38+ run : echo "id=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
39+ - name : Find correct JAR
40+ if : ${{ github.event_name == 'push' }}
41+ id : find-jar
42+ run : |
43+ output="$(find plugin/build/libs/ ! -name "*-javadoc.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
44+ echo "::set-output name=jarname::$output"
3745 - name : Release the build
46+ if : ${{ github.event_name == 'push' }}
3847 uses : ncipollo/release-action@v1
3948 with :
40- artifacts : " build/libs/velocity_tools-*. jar"
49+ artifacts : plugin/ build/libs/${{ steps.find- jar.outputs.jarname }}
4150 body : ${{ join(github.event.commits.*.message, '\n') }}
4251 prerelease : true
43- name : Dev-build
52+ name : Dev-build ${{ steps.git-version.outputs.id }}
4453 tag : dev-build
54+ - name : Upload to Modrinth
55+ if : ${{ github.event_name == 'push' }}
56+ 57+ with :
58+ token : ${{ secrets.MODRINTH_TOKEN }}
59+ file_path : plugin/build/libs/${{ steps.find-jar.outputs.jarname }}
60+ name : Dev-build ${{ steps.git-version.outputs.id }}
61+ version : ${{ steps.git-version.outputs.id }}
62+ changelog : ${{ join(github.event.commits.*.message, '\n') }}
63+ game_versions : 1.7.2
64+ release_type : beta
65+ loaders : velocity
66+ featured : false
67+ project_id : 4mehh1CR
0 commit comments