Skip to content

Commit 7aa9faf

Browse files
Merge pull request #4 from SLNE-Development/cleanup
Cleanup
2 parents f69a976 + 1e0ff9c commit 7aa9faf

Some content is hidden

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

45 files changed

+1060
-797
lines changed

.github/workflows/publish.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Publish to Maven & Create GitHub Release
2+
3+
on:
4+
push:
5+
branches:
6+
- 'version/*'
7+
workflow_dispatch:
8+
9+
env:
10+
SLNE_SNAPSHOTS_REPO_USERNAME: ${{ secrets.SLNE_SNAPSHOTS_REPO_USERNAME }}
11+
SLNE_SNAPSHOTS_REPO_PASSWORD: ${{ secrets.SLNE_SNAPSHOTS_REPO_PASSWORD }}
12+
SLNE_RELEASES_REPO_USERNAME: ${{ secrets.SLNE_RELEASES_REPO_USERNAME }}
13+
SLNE_RELEASES_REPO_PASSWORD: ${{ secrets.SLNE_RELEASES_REPO_PASSWORD }}
14+
MODULE_REGEX: "surf-friends-api.*-all\\.jar$|surf-friends-velocity.*-all\\.jar$"
15+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
environment: production
21+
steps:
22+
- name: Collect Workflow Telemetry
23+
uses: catchpoint/workflow-telemetry-action@v2
24+
25+
- name: Checkout Repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Cache Gradle packages
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: gradle-${{ runner.os }}-
38+
39+
- name: Setup JDK
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: 'graalvm'
43+
java-version: '24'
44+
45+
- name: Build all modules with Gradle
46+
run: ./gradlew build shadowJar --parallel --no-scan
47+
48+
- name: Publish all modules to Maven
49+
run: ./gradlew publish --parallel --no-scan
50+
51+
- name: Extract Project Version and Snapshot Flag from Gradle
52+
id: get_version
53+
run: |
54+
VERSION=$(./gradlew properties --no-daemon \
55+
| grep '^version:' \
56+
| awk '{print $2}')
57+
SNAPSHOT_FLAG=$(./gradlew properties --no-daemon \
58+
| grep '^snapshot:' \
59+
| awk '{print $2}')
60+
if [ "$SNAPSHOT_FLAG" = "true" ]; then
61+
VERSION="${VERSION}-SNAPSHOT"
62+
fi
63+
echo "VERSION=$VERSION" >> $GITHUB_ENV
64+
echo "SNAPSHOT_FLAG=$SNAPSHOT_FLAG" >> $GITHUB_ENV
65+
66+
- name: Determine release flags
67+
run: |
68+
CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
69+
# prerelease only for snapshots
70+
if [ "${SNAPSHOT_FLAG}" = "true" ]; then
71+
echo "PRERELEASE=true" >> $GITHUB_ENV
72+
else
73+
echo "PRERELEASE=false" >> $GITHUB_ENV
74+
fi
75+
# make_latest false for snapshots or non-default branches
76+
if [ "${SNAPSHOT_FLAG}" = "true" ] || [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
77+
echo "MAKE_LATEST=false" >> $GITHUB_ENV
78+
else
79+
echo "MAKE_LATEST=true" >> $GITHUB_ENV
80+
fi
81+
82+
- name: Find and filter JAR files
83+
id: find_jars
84+
run: |
85+
echo "JAR_FILES<<EOF" >> $GITHUB_ENV
86+
find . -path "**/build/libs/*.jar" \
87+
| grep -E "${{ env.MODULE_REGEX }}" \
88+
>> $GITHUB_ENV
89+
echo "EOF" >> $GITHUB_ENV
90+
91+
- name: Create GitHub Release
92+
uses: softprops/action-gh-release@v2
93+
with:
94+
tag_name: v${{ env.VERSION }}
95+
name: Release ${{ env.VERSION }}
96+
draft: false
97+
prerelease: ${{ env.PRERELEASE }}
98+
make_latest: ${{ env.MAKE_LATEST }}
99+
files: ${{ env.JAR_FILES }}
100+
generate_release_notes: true
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ plugins {
33
}
44

55
allprojects {
6-
group = "dev.slne"
7-
version = "1.7.0-SNAPSHOT"
6+
group = "dev.slne.surf.friends"
7+
version = findProperty("version") as String
88
}
99

1010
buildscript {
@@ -13,6 +13,16 @@ buildscript {
1313
maven("https://repo.slne.dev/repository/maven-public/") { name = "maven-public" }
1414
}
1515
dependencies {
16-
classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.4+")
16+
classpath("dev.slne.surf:surf-api-gradle-plugin:1.21.7+")
17+
}
18+
}
19+
20+
subprojects {
21+
afterEvaluate {
22+
plugins.withType<JavaPlugin> {
23+
configure<JavaPluginExtension> {
24+
toolchain.languageVersion.set(JavaLanguageVersion.of(24))
25+
}
26+
}
1727
}
1828
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
kotlin.code.style=official
12
kotlin.stdlib.default.dependency=false
23
org.gradle.parallel=true
3-
4-
dev-build = true
4+
version=1.21.8-2.0.1-SNAPSHOT

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
surf-database = "1.0.5-SNAPSHOT"
2+
surf-database = "2.2.1-SNAPSHOT"
33

44
[libraries]
55
surf-database = { module = "dev.slne.surf:surf-database", version.ref = "surf-database" }

gradle/wrapper/gradle-wrapper.jar

42.7 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)