-
Notifications
You must be signed in to change notification settings - Fork 5
75 lines (61 loc) · 1.74 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
# GravenSupport CI/CD
# Maintained by AntoineJT
name: GravenSupport CI/CD
on:
push:
branches: "**"
tags-ignore: latest
pull_request:
branches: "**"
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Setup Gradle permission
run: chmod +x gradlew
- name: Check code formatting
run: ./gradlew spotlessCheck
- name: Execute Gradle build
run: ./gradlew build
- name: Cache everything for CD
if: github.ref_type == 'tag'
uses: actions/cache@v3
with:
path: .
key: ci-data
cd:
needs: ci
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
steps:
- name: Restore data from cache
uses: actions/cache@v3
with:
path: .
key: ci-data
- name: Prepare files for release
run: |
mkdir gh_release
cp LICENSE.md build/resources/main/config.default.yml build/libs/*-all.jar gh_release
- name: Create release zip file
uses: TheDoctor0/[email protected]
with:
filename: "GravenSupport-${{ github.sha }}.zip"
directory: ./gh_release
- name: Publish release '${{ github.ref_name }}'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: "latest"
prerelease: false
title: "GravenSupport '${{ github.ref_name }}'"
files: "./gh_release/GravenSupport-${{ github.sha }}.zip"