-
Notifications
You must be signed in to change notification settings - Fork 51
78 lines (65 loc) · 2.43 KB
/
gradle-build.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
# 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 package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
name: Build and Publish
on:
#schedule:
# - cron: '37 7 * * *'
push:
branches: [ "dev/2.0", "master" ]
# Publish semver tags as releases.
#tags: [ 'v*.*.*' ]
#pull_request:
# branches: [ "development", "master" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: shadowJar
- name: Copy files
run: |
mkdir -p temp
mkdir temp/modules/
mkdir temp/storage/
mkdir temp/storage/pluginJars/
cp start-files/*.* temp/
cp simplecloud-modules/**/build/libs/SimpleCloud-*.jar temp/modules/
cp simplecloud-runner/build/libs/runner.jar temp/runner.jar
cp simplecloud-base/build/libs/base.jar temp/storage/base.jar
cp simplecloud-plugin/build/libs/*.jar temp/storage/pluginJars/
cp simplecloud-dependency-loader/build/libs/dependency-loader.jar temp/storage/dependency-loader.jar
cp simplecloud-launcher/build/libs/launcher.jar temp/launcher.jar
rm temp/modules/SimpleCloud-Chat+Tab.jar
rm temp/modules/SimpleCloud-ServiceSelection.jar
rm temp/modules/SimpleCloud-CloudFlare.jar
rm temp/modules/SimpleCloud-Placeholders.jar
- name: Upload zip
uses: actions/upload-artifact@v3
with:
name: SimpleCloud-Latest
path: temp/
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
# the publishing section of your build.gradle
- name: Publish
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}