-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (75 loc) · 2.35 KB
/
gradle.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
75
76
77
78
79
80
81
82
83
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}@${{ github.ref }}+${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
cancel-in-progress: false
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
- name: Change Gradle Permissions
run: chmod +x gradlew
- name: Setup Gradle to generate and submit dependency graphs
uses: gradle/[email protected]
with:
dependency-graph: generate-and-submit
- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: build
- name: Shadow Jar
uses: gradle/[email protected]
with:
arguments: clean shadowJar
- name: Upload Artifact
uses: actions/[email protected]
with:
name: GalaxeSMP
path: build/libs/*-all.jar
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
name: Deploy
if: github.ref == 'refs/heads/main'
needs: build
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Download Artifact
uses: actions/[email protected]
with:
name: GalaxeSMP
path: build/libs/
- name: Deploy to Pterodactyl SFTP
uses: wangyucode/[email protected]
with:
host: ${{ secrets.DEV_HOST }}
username: ${{ secrets.DEV_USERNAME }}
password: ${{ secrets.DEV_PASSWORD }}
port: ${{ secrets.DEV_PORT }}
localDir: "build/libs/"
remoteDir: "plugins/"