forked from WiIIiam278/HuskHomes
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (128 loc) · 4.49 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Builds, tests the project with Gradle and uploads to Modrinth
name: CI Tests & Publish
on:
push:
branches: [ 'master' ]
paths-ignore:
- 'docs/**'
- 'workflows/**'
- 'README.md'
permissions:
contents: read
checks: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout for CI 🛎️'
uses: actions/checkout@v4
- name: 'Set up JDK 17 📦'
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: 'Build with Gradle 🏗️'
uses: gradle/gradle-build-action@v3
with:
arguments: build test publish
env:
SNAPSHOTS_MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
SNAPSHOTS_MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: 'Publish Test Report 📊'
uses: mikepenz/action-junit-report@v4
if: success() || failure() # Continue on failure
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: 'Fetch Version Name 📝'
run: |
echo "::set-output name=VERSION_NAME::$(${{github.workspace}}/gradlew properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}')"
id: fetch-version
- name: Get Version
run: |
echo "version_name=${{steps.fetch-version.outputs.VERSION_NAME}}" >> $GITHUB_ENV
- name: 'Spigot: Publish to Modrinth & Hangar 🚰'
uses: WiIIiam278/mc-publish@hangar
with:
modrinth-id: J6U9o3JG
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-dependencies: |
dynmap | suggests | *
bluemap | suggests | *
pl3xmap | suggests | *
plan | suggests | *
hangar-id: William278/HuskHomes
hangar-token: ${{ secrets.HANGAR_API_KEY }}
hangar-version-type: Alpha
files-primary: target/HuskHomes-Paper-${{ env.version_name }}.jar
name: HuskHomes (Spigot) v${{ env.version_name }}
version: ${{ env.version_name }}
version-type: alpha
changelog: ${{ github.event.head_commit.message }}
loaders: |
spigot
paper
folia
game-versions: |
1.17.1
1.18.2
1.19.4
1.20.4
java: 17
- name: 'Sponge: Publish to Modrinth 🧽'
uses: WiIIiam278/mc-publish@hangar
if: success() || failure()
with:
modrinth-id: J6U9o3JG
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-dependencies: |
bluemap | suggests | *
plan | suggests | *
files-primary: target/HuskHomes-Sponge-${{ env.version_name }}.jar
name: HuskHomes (Sponge) v${{ env.version_name }}
version: ${{ env.version_name }}
version-type: alpha
changelog: ${{ github.event.head_commit.message }}
loaders: |
sponge
game-versions: |
1.19.4
java: 17
- name: 'Fabric: Publish to Modrinth & CurseForge 🧵'
uses: WiIIiam278/mc-publish@hangar
if: success() || failure()
with:
modrinth-id: J6U9o3JG
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-id: 849217
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
dependencies: |
fabric-api | requires | *
dynmap | suggests | *
bluemap | suggests | *
pl3xmap | suggests | *
luckperms | suggests | *
plan | suggests | *
impactor | suggests | *
placeholder-api | suggests | *
files-primary: target/HuskHomes-Fabric-${{ env.version_name }}.jar
name: HuskHomes (Fabric) v${{ env.version_name }}
version: ${{ env.version_name }}
version-type: alpha
changelog: ${{ github.event.head_commit.message }}
loaders: |
fabric
game-versions: |
1.20.4
java: 17
- name: 'Upload GitHub Artifacts 📦'
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: HuskHomes
path: |
target/HuskHomes-Paper-${{ env.version_name }}.jar
target/HuskHomes-Sponge-${{ env.version_name }}.jar
target/HuskHomes-Fabric-${{ env.version_name }}.jar