Skip to content

Commit 49f8201

Browse files
authored
Merge pull request #40 from Astra-Interactive/improve-arch
- Improve architecture - Add docker-compose to create test server - Upgrade CI to auto-upload modrinth - Better forge build
2 parents efd949a + 4d41641 commit 49f8201

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+265
-84
lines changed

.github/workflows/call-build-project.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
target: [ ":instances:fabric", ":instances:forge", ":instances:velocity", ":instances:plugin" ]
10+
include:
11+
- id: "fabric"
12+
task: ":instances:fabric:build"
13+
- id: "forge"
14+
task: ":instances:forge:build"
15+
- id: "velocity"
16+
task: ":instances:velocity:build"
17+
- id: "bukkit"
18+
task: ":instances:bukkit:build"
1119
steps:
1220
- name: Checkout Git repo
1321
uses: actions/checkout@v4
@@ -21,4 +29,4 @@ jobs:
2129
- name: Build with Gradle
2230
uses: gradle/gradle-build-action@v3
2331
with:
24-
arguments: ${{ matrix.target }}:build --stacktrace
32+
arguments: ${{ matrix.task }} --stacktrace
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Upload artifacts"
2+
on:
3+
workflow_call:
4+
jobs:
5+
upload_artifacts:
6+
name: Build and upload
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
include:
11+
- id: "fabric"
12+
task: ":instances:fabric:assemble"
13+
- id: "forge"
14+
task: ":instances:forge:shadowJar"
15+
- id: "velocity"
16+
task: ":instances:velocity:shadowJar"
17+
- id: "bukkit"
18+
task: ":instances:bukkit:shadowJar"
19+
steps:
20+
- name: Checkout Git repo
21+
uses: actions/checkout@v4
22+
- uses: christian-draeger/read-properties@1.1.1
23+
id: properties
24+
with:
25+
path: './gradle.properties'
26+
properties: 'makeevrserg.project.name'
27+
- name: Set up JDK 21
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: 'adopt'
31+
java-version: 21
32+
- name: Give gradle permission
33+
run: chmod +x gradlew
34+
- name: Build with Gradle ${{ matrix.id }}
35+
uses: gradle/gradle-build-action@v3
36+
with:
37+
arguments: ${{ matrix.task }} --stacktrace
38+
- uses: actions/upload-artifact@184d73b71b93c222403b2e7f1ffebe4508014249
39+
name: "Upload ${{ matrix.id }}"
40+
with:
41+
name: ${{ matrix.id }}
42+
path: ./jars/${{ steps.properties.outputs.makeevrserg-project-name }}-${{ matrix.id }}*.jar

.github/workflows/call-create-artifacts.yml renamed to .github/workflows/call-upload-github-release.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,44 @@
1-
name: "detekt-validation"
1+
name: "Upload GitHub release"
22
on:
33
workflow_call:
44
secrets:
55
ACTIONS_TOKEN:
66
required: true
77
jobs:
8-
publish:
9-
name: Build and upload
8+
upload_github_release:
9+
name: Upload GitHub release
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout Git repo
1313
uses: actions/checkout@v4
14+
1415
- uses: christian-draeger/read-properties@1.1.1
1516
id: properties
1617
with:
1718
path: './gradle.properties'
1819
properties: 'makeevrserg.project.name makeevrserg.project.version.string'
19-
- name: Set up JDK 21
20-
uses: actions/setup-java@v4
20+
21+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
22+
name: "Download velocity"
2123
with:
22-
distribution: 'adopt'
23-
java-version: 21
24-
- name: Give gradle permission
25-
run: chmod +x gradlew
26-
- name: Build with Gradle
27-
uses: gradle/gradle-build-action@v3
24+
name: velocity
25+
path: ./jars
26+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
27+
name: "Download forge"
2828
with:
29-
arguments: shadowJar :instances:fabric:assemble --stacktrace
29+
name: forge
30+
path: ./jars
31+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
32+
name: "Download fabric"
33+
with:
34+
name: fabric
35+
path: ./jars
36+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
37+
name: "Download bukkit"
38+
with:
39+
name: bukkit
40+
path: ./jars
41+
3042
- name: Create release
3143
id: create_internal_release
3244
uses: softprops/action-gh-release@v2
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Upload Modrinth release"
2+
on:
3+
workflow_call:
4+
secrets:
5+
MODRINTH_TOKEN:
6+
required: true
7+
jobs:
8+
upload_github_release:
9+
name: Upload GitHub release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Git repo
13+
uses: actions/checkout@v4
14+
15+
- uses: christian-draeger/read-properties@1.1.1
16+
id: properties
17+
with:
18+
path: './gradle.properties'
19+
properties: 'makeevrserg.project.name makeevrserg.project.version.string'
20+
21+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
22+
name: "Download velocity"
23+
with:
24+
name: velocity
25+
path: ./jars
26+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
27+
name: "Download forge"
28+
with:
29+
name: forge
30+
path: ./jars
31+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
32+
name: "Download fabric"
33+
with:
34+
name: fabric
35+
path: ./jars
36+
- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
37+
name: "Download bukkit"
38+
with:
39+
name: bukkit
40+
path: ./jars
41+
- uses: Kir-Antipov/mc-publish@v3.3
42+
with:
43+
# Only include this section if you wish to publish
44+
# your assets on Modrinth.
45+
modrinth-id: 6NpNwzA1
46+
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
47+
name: ${{ steps.properties.outputs.makeevrserg-project-name }}
48+
version: ${{ steps.properties.outputs.makeevrserg-project-version-string }}
49+
changelog: ${{ join(github.event.commits.*.message, '\n') }}
50+
version_type: beta
51+
java: |
52+
21
53+
loaders: |
54+
velocity
55+
fabric
56+
forge
57+
bukkit
58+
game-versions: |
59+
[1.16,1.21.1)
60+
files: |
61+
./jars/*.jar

.github/workflows/release-master.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ on:
66
jobs:
77
gradle_validation:
88
uses: ./.github/workflows/call-gradle-wrapper-validation.yml
9-
create_artifact:
9+
upload_artifacts:
1010
needs: [ gradle_validation ]
11-
uses: ./.github/workflows/call-create-artifacts.yml
11+
uses: ./.github/workflows/call-upload-artifacts.yml
12+
upload_github_artifacts:
13+
needs: [ upload_artifacts ]
14+
uses: ./.github/workflows/call-upload-github-release.yml
1215
secrets:
1316
ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
17+
18+
upload_modrinth_artifacts:
19+
needs: [ upload_artifacts ]
20+
uses: ./.github/workflows/call-upload-modrinth-release.yml
21+
secrets:
22+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

.gitignore

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
# root
22
.gradle
33
.idea
4+
.kotlin
45
astra.properties
56
local.properties
67
build
78
jars
8-
# build-logic
9-
build-logic/.gradle
10-
build-logic/plugins/convention/build
11-
# fabric
12-
fabric/build
13-
# forge
14-
forge/build
159
# modules
1610
modules/api-local/build
1711
modules/api-remote/build
1812
modules/dto/build
19-
# plugin
20-
plugin/build
21-
# velocity
22-
velocity/build
13+
# instances
14+
instances/fabric
15+
instances/forge
16+
instances/plugin
17+
instances/velocity

README.md

Lines changed: 27 additions & 20 deletions

docker-compose.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
services:
2+
# For command call use `docker exec mc rcon-cli <your_command>`
3+
mc_docker:
4+
restart: no
5+
container_name: mc_docker
6+
image: itzg/minecraft-server # https://github.com/itzg/docker-minecraft-server
7+
tty: true
8+
stdin_open: true
9+
ports:
10+
- "25565:25565"
11+
environment:
12+
EULA: true
13+
# Forge
14+
TYPE: FORGE
15+
VERSION: "1.20.1"
16+
FORGE_VERSION: "47.2.20"
17+
# Custom server
18+
#TYPE: CUSTOM
19+
#CUSTOM_SERVER: https://api.papermc.io/v2/projects/paper/versions/1.21.1/builds/121/downloads/paper-1.21.1-121.jar
20+
#VERSION: 1.21.1
21+
volumes:
22+
# Forge
23+
- ./build/forge:/data
24+
# Bukkit/Paper/Spigot
25+
- ./build/bukkit:/data
26+
# Velocity
27+
- ./build/velocity:/data
28+
# Fabric
29+
- ./build/fabric:/data

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ makeevrserg.java.ktarget=21
99
# Project
1010
makeevrserg.project.name=AstraTemplate
1111
makeevrserg.project.group=ru.astrainteractive.astratemplate
12-
makeevrserg.project.version.string=7.7.0
12+
makeevrserg.project.version.string=7.7.1
1313
makeevrserg.project.description=Template plugin for EmpireProjekt
1414
makeevrserg.project.developers=makeevrserg|Makeev Roman|makeevrserg@gmail.com
1515
makeevrserg.project.url=https://github.com/Astra-Interactive/AstraTemplate

0 commit comments

Comments
 (0)